Part Number Hot Search : 
MC74VH 24STS15 AUIRF 47110 RC455 LT1014MJ ST115006 2SC6013
Product Description
Full Text Search
 

To Download 68HC05PL4B Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  hc05pl4grs/h rev 2.0 68hc05pl4 68HC05PL4B 68hc705pl4 68hc705pl4b specification (general release) april 30, 1998 consumer systems group semiconductor products sector f r e e s c a l e s e m i c o n d u c t o r , i f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 rev 2.0 i table of contents section page section 1 general description 1.1 features ...................................................................................................... 1-1 1.2 mcu block diagram .................................................................................. 1-2 1.3 pin assignments ........................................................................................ 1-3 1.4 pin descriptions ....................................................................................... 1-4 1.4.1 vdd, vss .................................................................................................... 1-4 1.4.2 osc1, osc2 ............................................................................................... 1-4 1.4.3 reset ......................................................................................................... 1-4 1.4.4 led/irq ...................................................................................................... 1-4 1.4.5 pa0, pa1/dtmf, pa2/tcap, pa3/tcmp, pa4-pa6 .................................. 1-5 1.4.6 pb0/kbi0-pb3/kbi3, pb4-pb7.................................................................... 1-5 1.4.7 pc0-pc7...................................................................................................... 1-6 section 2 memory 2.1 memory map ................................................................................................ 2-1 2.2 i/o registers .............................................................................................. 2-2 2.3 ram ................................................................................................................. 2-2 2.4 rom................................................................................................................. 2-2 2.5 cop watchdog register (copr).......................................................... 2-2 section 3 central processing unit 3.1 registers .................................................................................................... 3-1 3.2 accumulator (a) ....................................................................................... 3-2 3.3 index register (x) ..................................................................................... 3-2 3.4 stack pointer (sp) .................................................................................... 3-2 3.5 program counter (pc) ........................................................................... 3-2 3.6 condition code register (ccr) ........................................................... 3-3 3.6.1 half carry bit (h-bit) .................................................................................... 3-3 3.6.2 interrupt mask (i-bit) .................................................................................... 3-3 3.6.3 negative bit (n-bit) ...................................................................................... 3-3 3.6.4 zero bit (z-bit) ............................................................................................. 3-3 3.6.5 carry/borrow bit (c-bit) ............................................................................... 3-4 section 4 interrupts 4.1 interrupt vectors .................................................................................. 4-1 4.2 interrupt processing ........................................................................... 4-2 4.3 software interrupt ............................................................................... 4-4 4.4 external interrupt ................................................................................ 4-4 4.4.1 led/irq pin ................................................................................................ 4-4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 mc68hc05pl4 ii rev 2.0 table of contents section page 4.4.2 miscellaneous control and status register................................................. 4-5 4.5 16-bit timer interrupts .......................................................................... 4-6 4.5.1 input capture interrupt................................................................................. 4-6 4.5.2 output compare interrupt............................................................................ 4-6 4.5.3 timer overflow interrupt .............................................................................. 4-6 4.6 8-bit timer interrupt .............................................................................. 4-6 4.7 keyboard interrupt ............................................................................... 4-7 section 5 resets 5.1 power-on reset ........................................................................................ 5-1 5.2 external reset ......................................................................................... 5-2 5.3 internal resets ........................................................................................ 5-2 5.3.1 power-on reset (por) ............................................................................... 5-3 5.3.2 computer operating properly (cop) reset ................................................ 5-3 5.3.3 illegal address reset................................................................................... 5-4 5.4 reset states of subsystem in mcu ................................................... 5-5 5.4.1 cpu ............................................................................................................. 5-5 5.4.2 i/o registers................................................................................................ 5-5 5.4.3 8-bit timer ................................................................................................... 5-5 5.4.4 16-bit programmable timer......................................................................... 5-5 5.4.5 keyboard interrupt interface ........................................................................ 5-6 5.4.6 6-bit dac subsystem .................................................................................. 5-6 5.4.7 system clock option subsystem ................................................................ 5-6 5.4.8 miscellaneous subsystem ........................................................................... 5-6 5.5 reset characteristics .......................................................................... 5-7 section 6 operating modes 6.1 operating modes...................................................................................... 6-1 6.1.1 single-chip (normal) mode .......................................................................... 6-1 6.1.2 self-check mode .......................................................................................... 6-1 6.2 low power modes .................................................................................... 6-2 6.2.1 stop mode ................................................................................................. 6-2 6.2.2 wait mode.................................................................................................. 6-2 section 7 input/output ports 7.1 parallel ports ......................................................................................... 7-1 7.1.1 port data registers ..................................................................................... 7-2 7.1.2 port data direction registers ...................................................................... 7-2 7.2 port a............................................................................................................ 7-2 7.3 port b............................................................................................................ 7-3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 rev 2.0 iii table of contents section page 7.4 port c ........................................................................................................... 7-3 7.5 summary of port a and port b shared pins .................................. 7-3 section 8 system clocks 8.1 system clock source and frequency option.............................. 8-1 section 9 16-bit programmable timer 9.1 timer registers (tmrh, tmrl)............................................................... 9-2 9.2 alternate counter registers (acrh, acrl) .................................. 9-4 9.3 input capture registers ...................................................................... 9-5 9.4 output compare registers ................................................................. 9-6 9.5 timer control register (tcr) ............................................................. 9-8 9.5.1 miscellaneous control and status register for timer16 ............................. 9-9 9.6 timer status register (tsr)............................................................... 9-10 9.7 16-bit timer operation during wait mode ..................................... 9-11 9.8 16-bit timer operation during stop mode .................................... 9-11 section 10 8-bit timer 10.1 overview.................................................................................................... 10-1 10.2 timer8 control and status register (t8csr) ............................. 10-2 10.3 timer8 counter register (t8cntr) .................................................. 10-3 10.4 computer operating properly (cop) watchdog ...................... 10-3 10.5 8-bit timer operation during wait mode ....................................... 10-4 10.6 8-bit timer operation during stop mode ...................................... 10-4 section 11 digital to analog converter 11.1 dac control and data register ...................................................... 11-1 11.2 dac operation during wait mode .................................................... 11-1 11.3 dac operation during stop mode.................................................... 11-1 11.4 dac characteristics ............................................................................ 11-2 section 12 instruction set 12.1 addressing modes ................................................................................. 12-1 12.1.1 inherent...................................................................................................... 12-1 12.1.2 immediate .................................................................................................. 12-1 12.1.3 direct ......................................................................................................... 12-2 12.1.4 extended.................................................................................................... 12-2 12.1.5 indexed, no offset..................................................................................... 12-2 12.1.6 indexed, 8-bit offset .................................................................................. 12-2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 mc68hc05pl4 iv rev 2.0 table of contents section page 12.1.7 indexed, 16-bit offset ................................................................................ 12-3 12.1.8 relative...................................................................................................... 12-3 12.1.9 instruction types ....................................................................................... 12-3 12.1.10 register/memory instructions .................................................................... 12-4 12.1.11 read-modify-write instructions ................................................................. 12-5 12.1.12 jump/branch instructions .......................................................................... 12-5 12.1.13 bit manipulation instructions...................................................................... 12-7 12.1.14 control instructions.................................................................................... 12-7 12.1.15 instruction set summary ........................................................................... 12-8 section 13 electrical specifications 13.1 maximum ratings..................................................................................... 13-1 13.2 operating temperature range ........................................................ 13-1 13.3 thermal characteristics ................................................................... 13-1 13.4 supply current characteristics ................................................... 13-2 13.5 dc electrical characteristics (4v)................................................ 13-3 13.6 dc electrical characteristics (2v)................................................ 13-4 13.7 control timing (4v)................................................................................ 13-5 13.8 control timing (2v)................................................................................ 13-5 section 14 mechanical specifications 14.1 28-pin pdip (case 710) .............................................................................. 14-1 14.2 28-pin soic (case 751f)............................................................................ 14-1 14.3 28-pin ssop ................................................................................................. 14-2 appendix a mc68hc705pl4 a.1 introduction .............................................................................................a-1 a.2 memory .........................................................................................................a-1 a.3 bootloader mode ....................................................................................a-1 a.4 eprom programming ...............................................................................a-1 a.4.1 eprom program control register (pcn)...................................................a-2 a.4.2 programming sequence ..............................................................................a-3 a.5 eprom programming specifications ................................................a-3 a.6 supply current characteristics .....................................................a-6 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 rev 2.0 v list of figures figure title page 1-1 mc68hc05pl4 block diagram ....................................................................... 1-2 1-2 mc68hc05pl4 pin assignment ...................................................................... 1-3 1-3 mc68HC05PL4B pin assignment ................................................................... 1-3 1-4 oscillator connections ..................................................................................... 1-4 1-5 miscellaneous control and status register (micsr) ...................................... 1-5 2-1 mc68hc05pl4 memory map .......................................................................... 2-1 2-2 cop watchdog register (copr) .................................................................... 2-2 2-3 i/o registers $0000-$000f.............................................................................. 2-3 2-4 i/o registers $0010-$001f.............................................................................. 2-4 3-1 mc68hc05 programming model ..................................................................... 3-1 4-1 interrupt stacking order................................................................................... 4-2 4-2 interrupt flowchart ........................................................................................... 4-3 4-3 external interrupt logic .................................................................................... 4-5 4-4 miscellaneous control and status register (micsr) ...................................... 4-5 4-5 pull-up enable register (puer) ..................................................................... 4-7 4-6 keyboard interrupt enable register (kier) ..................................................... 4-7 4-7 keyboard interrupt flag register (kifr) ......................................................... 4-7 5-1 reset sources ................................................................................................. 5-1 5-2 miscellaneous control and status register (micsr) ...................................... 5-2 5-3 cop watchdog block diagram........................................................................ 5-3 5-4 cop watchdog register (copr) .................................................................... 5-3 5-5 miscellaneous control and status register (micsr) ...................................... 5-4 5-6 stop recovery timing diagram ....................................................................... 5-7 5-7 internal reset timing diagram ........................................................................ 5-8 6-1 stop/wait flowchart..................................................................................... 6-3 7-1 port input/output circuitry ............................................................................... 7-1 8-1 system clock control register (syscr) ........................................................ 8-1 9-1 programmable timer block diagram ............................................................... 9-1 9-2 timer counter and register block diagram .................................................... 9-2 9-3 programmable timer registers (tmrh, tmrl).............................................. 9-3 9-4 alternate counter block diagram .................................................................... 9-4 9-5 alternate counter registers (acrh, acrl) ................................................... 9-4 9-6 timer input capture block diagram................................................................. 9-5 9-7 input capture registers (icrh, icrl)............................................................. 9-6 9-8 timer output compare block diagram ............................................................ 9-7 9-9 output compare registers (ocrh, ocrl) .................................................... 9-7 9-10 timer control register (tcr) .......................................................................... 9-8 9-11 miscellaneous control and status register (miscr) ...................................... 9-9 9-12 timer status registers (tsr) ........................................................................ 9-10 10-1 timer8 block diagram ................................................................................... 10-1 10-2 timer8 control and status register............................................................... 10-2 10-3 timer8 counter register................................................................................ 10-3 11-1 dac control and data register ..................................................................... 11-1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 mc68hc05pl4 vi rev 2.0 list of figures figure title page a-1 mc68hc705pl4b memory map .....................................................................a-2 a-2 eprom programming sequence ....................................................................a-4 a-3 mc68hc705pl4 pin assignment ....................................................................a-5 a-4 mc68hc705pl4b pin assignment .................................................................a-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 rev 2.0 vii list of tables table title page 1-1 mc68hc05pl4 and mc68HC05PL4B differences ......................................... 1-1 4-1 vector address for interrupts and reset.......................................................... 4-1 5-1 reset characteristics ....................................................................................... 5-7 6-1 operation mode condition after reset ............................................................ 6-1 7-1 i/o pin functions ............................................................................................. 7-2 7-2 port a and port b shared pins ........................................................................ 7-3 8-1 system clock divider select ............................................................................ 8-1 8-2 system clock source select............................................................................ 8-1 9-1 output compare initialization example............................................................ 9-8 12-1 register/memory instructions ........................................................................ 12-4 12-2 read-modify-write instructions ..................................................................... 12-5 12-3 jump and branch instructions ....................................................................... 12-6 12-4 bit manipulation instructions .......................................................................... 12-7 12-5 control instructions ........................................................................................ 12-7 12-6 instruction set summary .............................................................................. 12-8 12-7 opcode map ................................................................................................ 12-14 a-1 mc68hc705pl4 and mc68hc705pl4b differences .....................................a-1 a-2 eprom programming electrical characteristics .............................................a-3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 mc68hc05pl4 viii rev 2.0 list of tables table title page f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 general description rev 2.0 1-1 section 1 general description the mc68hc05pl4 hcmos microcontroller is a member of the m68hc05 fam- ily of low-cost single-chip microcontroller units (mcus). this mcu is designed speci cally f or the handset and base set of cost-sensitive ct0/1 analog cordless phones. references to mc68hc05pl4 apply to both mc68hc05pl4 and mc68HC05PL4B, unless otherwise stated. 1.1 features ? industry standard 8-bit m68hc05 cpu core ? bus frequency: 2.56mhz @ 4v and 1mhz @ 2v ? built-in low-frequency rc oscillator (500khz and 20khz) ? osc input pin (osc output pin on mc68HC05PL4B) ? 256 bytes of user ram ? 4k-bytes of user rom ? rom security ? 23 (22 for mc68HC05PL4B) bidirectional i/o lines with: C 4 keyboard interrupts with pull-up resistor C 6 high current sink pins ? open-drain output for led drive ? multiplexed dtmf output with built-in 6-bit d/a ? 16-bit programmable timer with input capture and output compare functions ? reloadable 8-bit event timer ? cop watchdog reset ? power saving stop and wait modes ? available in 28-pin pdip, soic, and ssop packages table 1-1. mc68hc05pl4 and mc68HC05PL4B differences device pin 27 mc68hc05pl4 pa0 mc68HC05PL4B osc2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 general description mc68hc05pl4 1-2 rev 2.0 1.2 mcu block diagram figure 1-1. mc68hc05pl4 block diagram note a line over a signal name indicates an active low signal. any reference to voltage, current, or frequency speci ed in the following sections will refer to the nominal values. the exact values and their tolerance or limits are speci ed in electr ical speci cations section. user rom - 4k bytes user ram - 256 bytes accumulator index register stack pointer program counter condition code register m68hc05 cpu reset 0 12 1 1h i nzc osc power osc1 vdd vss ddr b port b pb4- pb7 4 1 1 7 0 7 50 1 0 0 0 0 0 0 4 15 0 7 ddr a port a keyboard interrupt watchdog system pa 6 pa 5 pa 4 pa3/tcmp pa2/tcap pa1/dtmf pa 0 ? 4 16-bit programmable timer very low frequency osc (rc: 500khz or 20khz) ( ? n optional) dtmf module led/irq led drive ddr c port c pc0 - pc7 8 8-bit reloadable event timer pb0/kbi0 pb1/kbi1 pb2/kbi2 pb3/kbi3 osc2 ?? ?? available on mc68HC05PL4B only. ? available on mc68hc05pl4 only. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 general description rev 2.0 1-3 1.3 pin assignments figure 1-2. mc68hc05pl4 pin assignment figure 1-3. mc68HC05PL4B pin assignment 1 2 3 4 5 6 7 8 9 10 28 27 26 25 24 23 22 21 20 19 vss vdd pc7 pc6 reset pb7 pb6 pb5 pb4 pb3/kbi3 pc5 pc4 pb2/kbi2 pb1/kbi1 osc1 pa0 pc0 pc1 pa1/dtmf pa2/tcap pa3/tcmp pa4 pa5 pa6 pc2 pc3 led/irq pb0/kbi0 11 12 13 14 18 17 16 15 1 2 3 4 5 6 7 8 9 10 28 27 26 25 24 23 22 21 20 19 vss vdd pc7 pc6 reset pb7 pb6 pb5 pb4 pb3/kbi3 pc5 pc4 pb2/kbi2 pb1/kbi1 osc1 osc2 pc0 pc1 pa1/dtmf pa2/tcap pa3/tcmp pa4 pa5 pa6 pc2 pc3 led/irq pb0/kbi0 11 12 13 14 18 17 16 15 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 general description mc68hc05pl4 1-4 rev 2.0 1.4 pin descriptions the following paragraphs give a description of each functional pin. 1.4.1 vdd, vss power is supplied to the mcu using these pins. vdd is the positive supply and vss is the ground pin. 1.4.2 osc1, osc2 osc2 is only available on mc68HC05PL4B. the osc1 and osc2 pins are the connections for the on-chip oscillator the following con gur ations are available: 1. a crystal or ceramic resonator as shown in figure 1-4(a). 2. an external clock signal as shown in figure 1-4(b). the external oscillator clock frequency, f osc , is divided by two to produce the internal operating frequency, f op . figure 1-4. oscillator connections 1.4.3 reset this active low input-only pin is used to reset the mcu to a known start-up state. the reset pin has an schmitt trigger circuit as part of its input to improve noise immunity. 1.4.4 led/irq this pin has two functions, con gured b y the irqen bit in the miscellaneous con- trol and status register, at $1c (miscr). when this pin is irq , it drives the asynchronous irq interrupt function of the cpu. the irq interrupt function uses the irqs bit in the miscr to provide either only negative edge-sensitive triggering or both negative edge-sensitive and low level-sensitive triggering. if the miscr bit is set to enable level-sensitive mcu (a) crystal or ceramic resonator connections osc1 osc2 2 m w unconnected external clock (c) external clock source connection osc1 osc2 mcu f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 general description rev 2.0 1-5 triggering, the led/irq pin requires an external resistor to vdd for wired-or operation. if the led/irq is not used, it must be tied to the vdd supply. the contains an internal schmitt trigger as part of its input to improve noise immunity. when this pin is led, the led bit in the miscr controls the on/off function of the connected led. this led pin sinks current via an internal pulldown resistor. irqen ?external interrupt request enable 0 = led/irq pin con gured as led dr ive pin. 1 = led/irq pin con gured as irq input pin, for external interrupts. led ?led drive output control 1 = enable internal pulldown resistor, pin is logic low. 0 = disable internal pulldown resistor, pin is in high impedance state. 1.4.5 pa0, pa1/dtmf, pa2/tcap, pa3/tcmp, pa4-pa6 these eight i/o lines comprise port a, a general purpose bidirectional i/o port. the state of any pin is software programmable and all port b lines are con gured as inputs during power-on or reset. pa0 is only available on mc68hc05pl4. pa1 is shared with dtmf output of the dac subsystem. this pin is con gured as an output pin for dtmf. pa2 is shared with tcap input of the 16-bit timer. this pin is con gured as an input pin for tcap. pa3 is shared with tcmp output of the 16-bit timer. this pin is con gured as an output pin for tcmp. pa5 and pa6 have high current sinking capability; see electrical speci cations section for values. 1.4.6 pb0/kbi0-pb3/kbi3, pb4-pb7 these eight i/o lines comprise port b, a general purpose bidirectional i/o port. the state of any pin is software programmable and all port b lines are con gured as inputs during power-on or reset. all port b pins have internal pullups which can be individually enabled by software. pb0-pb3 also have keyboard interrupt capability, which can be individually enabled. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 micsr r irqen irqs tcmpen tcapen led copon por $001c w reset 00000000 figure 1-5. miscellaneous control and status register (micsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 general description mc68hc05pl4 1-6 rev 2.0 1.4.7 pc0-pc7 these eight i/o lines comprise port c, a general purpose bidirectional i/o port. the state of any pin is software programmable and all port c lines are con gured as inputs during power-on or reset. pc4-pc7 have high current sinking capability; see electrical speci cations sec- tion for values. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 memory rev 2.0 2-1 section 2 memory this section describes the organization of the memory on the mc68hc05pl4. 2.1 memory map the cpu can address 8k-bytes of memory space as shown in figure 2-1 . the rom portion of the memory holds the program instructions, xed data, user de ned v ectors, and interrupt service routines. the ram portion of memory holds variable data. i/o registers are memory mapped so that the cpu can access their locations in the same way that it accesses all other memory locations. figure 2-1. mc68hc05pl4 memory map i/o registers 32 bytes user ram 256 bytes unused user rom 4096 bytes self-check rom 496 bytes $0000 $001f $0020 $011f $0120 $0dff $0e00 $1dff $1e00 $1fef $1fff $1ff0 $00c0 $00ff stack 64 bytes user vectors 16 bytes reserved reserved keyboard 8-bit timer 16-bit timer irq swi reset $1ff0-$1ff1 $1ff2-$1ff3 $1ff4-$1ff5 $1ff6-$1ff7 $1ff8-$1ff9 $1ffa-$1ffb $1ffc-$1ffd $1ffe-$1fff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 memory mc68hc05pl4 2-2 rev 2.0 2.2 i/o registers the rst 32 addresses of the memor y space, $0000-$001f, are the i/o section. one i/o register is located outside the 32-byte i/o section, which is the computer operating properly (cop) register mapped at $1ff0. the bit assignment of each i/o register is described in the respective sections and summarized in figure 2-3 and figure 2-4 . 2.3 ram the 256 addresses from $0020 to $01ff serve as both user ram and the stack ram. the cpu uses v e ram bytes to save all cpu register contents before pro- cessing an interrupt. during a subroutine call, the cpu uses two bytes to store the return address. the stack pointer decrements during pushes and increments dur- ing pulls. note be careful when using nested subroutines or multiple interrupt levels. the cpu may overwrite data in the ram during a subroutine or during the interrupt stacking operation. 2.4 rom the 4096 bytes of user rom is located from address $0e00 to $1dff. addresses $1ff0 to $1fff contain 16 bytes of rom reserved for user vectors. 2.5 cop watchdog register (copr) writing 0 to the copc bit in the cop watchdog register ($1ff0) resets the cop watchdog timer. this is a write only register; writing a 1 to copc has no effect. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 copr r $1ff0 w copc reset uuuuuuuu figure 2-2. cop watchdog register (copr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 memory rev 2.0 2-3 addr register access bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 $0000 port a data r pa6 pa5 pa4 pa3 pa2 pa1 pa0 porta w $0001 port b data r pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 portb w $0002 port c data r pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 portc w $0003 reserved r w $0004 reserved r w $0005 port a data direction r ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 ddra w $0006 port b data direction r ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 ddrb w $0007 port c data direction r ddrc7 ddrc6 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 ddrc w $0008 reserved r w $0009 reserved r w $000a pull-up enable r pul7 pul6 pul5 pul4 pul3 pul2 pul1 pul0 puer w $000b keyboard int. enable r kie3 kie2 kie1 kie0 kier w $000c keyboard int. flag r kif3 kif2 kif1 kif0 kifr w $000d timer 8 ctrl/status r t8if 0 t8ie t8en ps2 ps1 ps0 t8csr w t8ifr $000e timer 8 counter r t8cnt7 t8cnt6 t8cnt5 t8cnt4 t8cnt3 t8cnt2 t8cnt1 t8cnt0 t8cntr w $000f dac ctrl and data r dacen da5 da4 da3 da2 da1 da0 dacdr w figure 2-3. i/o registers $0000-$000f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 memory mc68hc05pl4 2-4 rev 2.0 addr register access bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 $0010 reserved r w $0011 reserved r w $0012 timer control r icie ocie toie iedg olvl tcr w $0013 timer status r icf ocf tof tsr w $0014 input capture high r icrh7 icrh6 icrh5 icrh4 icrh3 icrh2 icrh1 icrh0 icrh w $0015 input capture low r icrl7 icrl6 icrl5 icrl4 icrl3 icrl2 icrl1 icrl0 icrl w $0016 output compare high r ocrh7 ocrh6 ocrh5 ocrh4 ocrh3 ocrh2 ocrh1 ocrh0 ocrh w $0017 output compare low r ocrl7 ocrl6 ocrl5 ocrl4 ocrl3 ocrl2 ocrl1 ocrl0 ocrl w $0018 timer counter high r tmrh7 tmrh6 tmrh5 tmrh4 tmrh3 tmrh2 tmrh1 tmrh0 tmrh w $0019 timer counter low r tmrl7 tmrl6 tmrl5 tmrl4 tmrl3 tmrl2 tmrl1 tmrl0 tmrl w $001a alt. counter high r acrh7 acrh6 acrh5 acrh4 acrh3 acrh2 acrh1 acrh0 acrh w $001b alt. counter low r acrl7 acrl6 acrl5 acrl4 acrl3 acrl2 acrl1 acrl0 acrl w $001c misc. control/status r irqen irqs tcmpen tcapen led copon por micsr w $001d system clock control r sysdiv1 sysdiv2 cksel1 cksel2 fmode oscf rcf ckosc syscr w $001e reserved r w $001f reserved r w figure 2-4. i/o registers $0010-$001f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 central processing unit rev 2.0 3-1 section 3 central processing unit the mc68hc05pl4 has an 8k-bytes memory map. the stack has only 64 bytes. therefore, the stack pointer has been reduced to only 6 bits and will only decrement down to $00c0 and then wrap-around to $00ff. all other instructions and registers behave as described in this chapter. 3.1 registers the mcu contains v e registers which are hard-wired within the cpu and are not part of the memory map. these ve registers are shown in figure 3-1 and are described in the following paragraphs. figure 3-1. mc68hc05 programming model condition code register i accumulator 60 a index register 71 x 4 52 3 stack pointer sp 14 8 15 9 12 13 10 11 pc cc 111 11 0 0 0 0 0 0 0 0 program counter h nzc half-carry bit (from bit 3) interrupt mask negative bit zero bit carry bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 central processing unit mc68hc05pl4 3-2 rev 2.0 3.2 accumulator (a) the accumulator is a general purpose 8-bit register as shown in figure 3-1 . the cpu uses the accumulator to hold operands and results of arithmetic calculations or non-arithmetic operations. the accumulator is not affected by a reset of the device. 3.3 index register (x) the index register shown in figure 3-1 is an 8-bit register that can perform two functions: ? indexed addressing ? temporary storage in indexed addressing with no offset, the index register contains the low byte of the operand address, and the high byte is assumed to be $00. in indexed addressing with an 8-bit offset, the cpu nds the oper and address by adding the index register content to an 8-bit immediate value. in indexed addressing with a 16-bit offset, the cpu nds the operand address by adding the index register content to a 16-bit immediate value. the index register can also serve as an auxiliary accumulator for temporary storage. the index register is not affected by a reset of the device. 3.4 stack pointer (sp) the stack pointer shown in figure 3-1 is a 16-bit register. in mcu devices with memory space less than 64k-bytes the unimplemented upper address lines are ignored. the stack pointer contains the address of the next free location on the stack. during a reset or the reset stack pointer (rsp) instruction, the stack pointer is set to $00ff. the stack pointer is then decremented as data is pushed onto the stack and incremented as data is pulled off the stack. when accessing memory, the ten most signi cant bits are permanently set to 0000000011. the six least signi cant register bits are appended to these ten x ed bits to produce an address within the range of $00ff to $00c0. subroutines and interrupts may use up to 64($c0) locations. if 64 locations are exceeded, the stack pointer wraps around and overwrites the previously stored information. a subroutine call occupies two locations on the stack and an interrupt uses ve locations. 3.5 program counter (pc) the program counter shown in figure 3-1 is a 16-bit register. in mcu devices with memory space less than 64k-bytes the unimplemented upper address lines are ignored. the program counter contains the address of the next instruction or operand to be fetched. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 central processing unit rev 2.0 3-3 normally, the address in the program counter increments to the next sequential memory location every time an instruction or operand is fetched. jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. 3.6 condition code register (ccr) the ccr shown in figure 3-1 is a 5-bit register in which four bits are used to indicate the results of the instruction just executed. the fth bit is the interrupt mask. these bits can be individually tested by a program, and speci c actions can be taken as a result of their states. the condition code register should be thought of as having three additional upper bits that are always ones. only the interrupt mask is affected by a reset of the device. the following paragraphs explain the functions of the lower v e bits of the condition code register. 3.6.1 half carry bit (h-bit) when the half-carry bit is set, it means that a carry occurred between bits 3 and 4 of the accumulator during the last add or adc (add with carry) operation. the half-carry bit is required for binary-coded decimal (bcd) arithmetic operations. 3.6.2 interrupt mask (i-bit) when the interrupt mask is set, the internal and external interrupts are disabled. interrupts are enabled when the interrupt mask is cleared. when an interrupt occurs, the interrupt mask is automatically set after the cpu registers are saved on the stack, but before the interrupt vector is fetched. if an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. normally, the interrupt is processed as soon as the interrupt mask is cleared. a return from interrupt (rti) instruction pulls the cpu registers from the stack, restoring the interrupt mask to its state before the interrupt was encountered. after any reset, the interrupt mask is set and can only be cleared by the clear i-bit (cli), or wait instructions. 3.6.3 negative bit (n-bit) the negative bit is set when the result of the last arithmetic operation, logical operation, or data manipulation was negative. (bit 7 of the result was a logical one.) the negative bit can also be used to check an often tested ag b y assigning the ag to bit 7 of a register or memor y location. loading the accumulator with the contents of that register or location then sets or clears the negative bit according to the state of the ag. 3.6.4 zero bit (z-bit) the zero bit is set when the result of the last arithmetic operation, logical operation, data manipulation, or data load operation was zero. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 central processing unit mc68hc05pl4 3-4 rev 2.0 3.6.5 carry/borrow bit (c-bit) the carry/borrow bit is set when a carry out of bit 7 of the accumulator occurred during the last arithmetic operation, logical operation, or data manipulation. the carry/borrow bit is also set or cleared during bit test and branch instructions and during shifts and rotates. this bit is neither set by an inc nor by a dec instruction. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 interrupts rev 2.0 4-1 section 4 interrupts the cpu can be interrupted by ve different sources C one software and four hardware: ? non-maskable software interrupt instruction (swi) ? external asynchronous interrupt (irq ) ? 16-bit timer ? 8-bit timer ? keyboard interrupt 4.1 interrupt vectors table 4-1 summarizes the reset and interrupt sources and vector assignments table 4-1. vector address for interrupts and reset function source local mask global mask priority (1=highest) vector address reset power-on logic none none 1 $1ffe-$1fff reset pin none cop watchdog copon 1 swi user code none none same priority as instruction $1ffc-$1ffd external irq irq pin irqen i bit 2 $1ffa-$1ffb 16-bit timer icf bit icie i bit 3 $1ff8-$1ff9 tcf bit tcie ocf bit ocie 8-bit timer t8if bit t8ie i bit 4 $1ff6-$1ff7 keyboard kif3 bit kie3 i bit 5 $1ff4-$1ff5 kif2 bit kie2 kif1 bit kie1 kif0 bit kie0 reserved $1ff2-$1ff3 reserved $1ff0-$1ff1 notes: 1. copon enables/disables the cop watchdog timer. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 interrupts mc68hc05pl4 4-2 rev 2.0 note if more than one interrupt request is pending, the cpu fetches the vector of the higher priority interrupt rst. a higher priority interrupt does not actually interrupt a lower priority interrupt service routine unless the lower priority interrupt service routine clears the i bit. 4.2 interrupt processing the cpu does the following actions to begin servicing an interrupt: ? stores the cpu registers on the stack in the order shown in figure 4-1 ? sets the i bit in the condition code register to prevent further interrupts ? loads the program counter with the contents of the appropriate interrupt vector locations as shown in table 4-1 the return from interrupt (rti) instruction causes the cpu to recover its register contents from the stack as shown in figure 4-1 . the sequence of events caused by an interrupt is shown in the o w chart in figure 4-2 $0020 (bottom of ram) $0021 $00be $00bf $00c0 (bottom of stack) $00c1 $00c2 unstacking order ? n condition code register 5 1 n+1 accumulator 4 2 n+2 index register 3 3 n+3 program counter (high byte) 2 4 n+4 program counter (low byte) 1 5 y stacking $00fd order $00fe $00ff top of stack (ram) figure 4-1. interrupt stacking order f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 interrupts rev 2.0 4-3 figure 4-2. interrupt flowchart no external interrupt? i bit set? from reset yes yes clear irq latch. no execute instruction. unstack ccr, a, x, pch, pcl. fetch next instruction. stack pcl, pch, x, a, ccr. set i bit. load pc with interrupt vector. 16-bit timer interrupt? yes no 8-bit timer interrupt? yes no keyboard interrupt? yes no swi instruction? yes no rti instruction? yes no f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 interrupts mc68hc05pl4 4-4 rev 2.0 4.3 software interrupt the software interrupt (swi) instruction causes a non-maskable interrupt. 4.4 external interrupt the led/irq pin is the source that generates external interrupt. setting the i bit in the condition code register or clearing the irqen bit in the miscellaneous control/ status register disables this external interrupt. 4.4.1 led/irq pin this pin is an open drain pin and setting the irqen bit in miscellaneous control/ status register (micsr) will set this pin for external interrupt input pin. an interrupt signal on the led/irq pin latches an external interrupt request. to help clean up slow edges, the input from the led/irq pin is processed by a schmitt trigger gate. when the cpu completes its current instruction, it tests the irq latch. if the irq latch is set, the cpu then tests the i bit in the condition code register and the irqen bit in the micsr. if the i bit is clear and the irqen bit is set, then the cpu begins the interrupt sequence. the cpu clears the irq latch while it fetches the interrupt vector, so that another external interrupt request can be latched during the interrupt service routine. as soon as the i bit is cleared dur- ing the return from interrupt, the cpu can recognize the new interrupt request. figure 4-3 shows the logic for external interrupts. the led/irq pin can be negative edge-triggered only or negative edge- and low- level-triggered. external interrupt sensitivity is programmed with the irqs bit. with the edge- and level-sensitive trigger option, a falling edge or a low level on the led/irq pin latches an external interrupt request. the edge- and level-sensi- tive trigger option allows connection to the led/irq pin of multiple wired-or interrupt sources. as long as any source is holding the led/irq low, an external interrupt request is present, and the cpu continues to execute the interrupt ser- vice routine. with the edge-sensitive-only trigger option, a falling edge on the led/irq pin latches an external interrupt request. a subsequent interrupt request can be latched only after the voltage level on the led/irq pin returns to a logic one and then falls again to logic zero. note to use the external interrupt function to exit from wait or stop, it must be enabled prior entering either of the power saving modes. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 interrupts rev 2.0 4-5 figure 4-3. external interrupt logic 4.4.2 miscellaneous control and status register irqen ?external interrupt request enable this read/write bit enables external interrupts. reset clears the irqen bit. 0 = external interrupt processing disabled. led/irq pin return to normal led function 1 = external interrupt processing enabled. led/irq pin set to irq function irqs?external interrupt sensitivity this bit makes the external interrupt inputs level-triggered as well as edge-trig- gered. 0 = irq negative edge-triggered and low level-triggered. 1 = irq negative edge-triggered only. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 micsr r irqen irqs tcmpen tcapen led copon por $001c w reset 00000000 figure 4-4. miscellaneous control and status register (micsr) edge and level sensitive irqs vdd led/irq power on reset ph2 bih,bil instruction external reset external interrupt being serviced (read of vectors) irqen led q d r q d interrupt f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 interrupts mc68hc05pl4 4-6 rev 2.0 4.5 16-bit timer interrupts the 16-bit programmable timer can generate an interrupt whenever the following events occur: ? input capture ? output compare ? timer counter over o w setting the i bit in the condition code register disables timer interrupts. the con- trols for these interrupts are in the timer control register (tcr) located at $0012 and in the status bits are in the timer status register (tsr) located at $0013. the 16-bit programmable timer interrupts can wake up mcu from wait mode. 4.5.1 input capture interrupt an input capture interrupt occurs if the input capture ag (icf) becomes set while the input capture interrupt enable bit (icie) is also set. the icf ag bit is in the tsr; and the icie enable bit is located in the micsr. the icf ag bit is cleared by a read of the tsr with the icf ag bit is set; and then followed by a read of the lsb of the input capture register (icrl) or by reset. the icie enable bit is unaf- fected by reset. 4.5.2 output compare interrupt an output compare interrupt occurs if the output compare ag (ocf) becomes set while the output compare interrupt enable bit (ocie) is also set. the ocf ag bit is in the tsr and the ocie enable bit is in the micsr. the ocf ag bit is cleared by a read of the tsr with the ocf ag bit set; and then followed by an access to the lsb of the output compare register (ocrl) or by reset. the ocie enable bit is unaffected by reset. 4.5.3 timer over?w interrupt a timer over ow interrupt occurs if the timer over ow ag (tof) becomes set while the timer over o w interrupt enable bit (toie) is also set. the tof ag bit is in the tsr and the toie enable bit is in the tcr. the tof ag bit is cleared b y a read of the tsr with the tof ag bit set; and then followed by an access to the lsb of the timer registers (tmrl) or by reset. the toie enable bit is unaffected by reset. 4.6 8-bit timer interrupt the 8-bit timer can generate an interrupt when the timer8 counter register (t8cntr) decrements from preset value to zero and the interrupt enable bit is set. setting the i bit in the condition code register disables this timer interrupts. the control bit for this interrupt and status bit are in the timer 8 control register (t8csr) located at $000d. the 8-bit timer interrupt can wake up mcu from wait mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 interrupts rev 2.0 4-7 4.7 keyboard interrupt port b has internal pull-up resistors (typically 100k w ) and are enabled individually by setting the corresponding bit in the pull-up enable register (puer). pb0 to pb3 have keyboard interrupt functions, with individual enable and ag bits in registers $000b and $000c. a falling edge on any one of the keyboard interrupt pins sets the corresponding kif ag in the keyboard interrupt flag register (kifr) located at $000c. if the associated kie bit in the keyboard interrupt enable register (kier) located at $000b is also set, a keyboard interrupt is generated to the processor. kifx can be cleared by writing 1 to the bit. resets clear both kifr and kier. keyboard interrupt can wake up the mcu from wait mode or stop mode. note since the keyboard interrupt function is associated with pb0-pb3, any falling edge on these pins sets the corresponding kif ag in the k eyboard interrupt flag register. therefore, pb0-pb3 should be connected to internal or external pull- ups, and kifr cleared before these port pins switch from i/o to keyboard application. to use the keyboard interrupt function to exit from wait or stop, it must be enabled prior entering either of the power saving modes. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 puer r pul7 pul6 pul5 pul4 pul3 pul2 pul1 pul0 $000a w reset 00000000 figure 4-5. pull-up enable register (puer) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 kier r kie3 kie2 kie1 kie0 $000b w reset 00000000 figure 4-6. keyboard interrupt enable register (kier) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 kifr r kif3 kif2 kif1 kif0 $000c w reset 00000000 figure 4-7. keyboard interrupt flag register (kifr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 interrupts mc68hc05pl4 4-8 rev 2.0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 resets rev 2.0 5-1 section 5 resets this section describes the four reset sources and how they initialize the mcu. a reset immediately stops the operation of the instruction being executed, initializes certain control bits, and loads the program counter with a user de ned reset v ec- tor address. the following conditions produce a reset: ? initial power-up of device (power-on reset) ? a logic zero applied to the reset pin (external reset) ? time-out of the cop watchdog (cop reset) ? fetch of an opcode from an address not in the memory map (illegal address reset) figure 5-1. reset sources 5.1 power-on reset a positive transition on the v dd pin generates a power on reset. the power-on reset is strictly for conditions during powering up and cannot be used to detect drops in power supply voltage. reset reset latch r copon cop watchdog power-on reset illegal address reset internal d internal clock s rst to cpu and v dd 4-cycle counter subsystems address bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 resets mc68hc05pl4 5-2 rev 2.0 a 4064 t cyc (internal clock cycle) delay after the oscillator becomes active allows the clock generator to stabilize. if the reset pin is at logic zero at the end of the multiple t cyc time, the mcu remains in the reset condition until the signal on the reset pin goes to a logic one. por - power on reset flag the por bit is set each time the device is powered on. it allows the user to make a software distinction between a power-on and an external reset. por can be cleared by software by writing a 0 to the bit. it cannot be set by soft- ware. 5.2 external reset a logic zero applied to the reset pin for 1.5t cyc generates an external reset. this pin is connected to a schmitt trigger input gate to provide an upper and lower threshold voltage separated by a minimum amount of hysteresis. the external reset occurs whenever the reset pin is pulled below the lower threshold and remains in reset until the reset pin rises above the upper threshold. this active low input will generate the internal rst signal that resets the cpu and peripher- als. the reset pin can also act as an open drain output. it will be pulled to a low state by an internal pulldown device that is activated by three internal reset sources. this reset pulldown device will only be asserted for 3-4 cycles of the internal clock, f op , or as long as the internal reset source is asserted. when the external reset pin is asserted, the pulldown device will not be turned on. note do not connect the reset pin directly to v dd , as this may overload some power supply designs when the internal pulldown on the reset pin activates. 5.3 internal resets the four internally generated resets are the initial power-on reset function, the cop watchdog timer reset, the low voltage reset, and the illegal address detector. only the cop watchdog timer reset, low voltage reset and illegal address detec- tor will also assert the pulldown device on the reset pin for the duration of the reset function or 3-4 internal clock cycles, whichever is longer. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 micsr r irqen irqs tcmpen tcapen led copon por $001c w reset 00000000 figure 5-2. miscellaneous control and status register (micsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 resets rev 2.0 5-3 5.3.1 power-on reset (por) the internal por is generated on power-up to allow the clock oscillator to stabi- lize. the por is strictly for power turn-on conditions and is not able to detect a drop in the power supply voltage (brown-out). there is an oscillator stabilization delay of 4064 internal processor bus clock cycles after the oscillator becomes active. the por will generate the rst signal which will reset the cpu. if any other reset function is active at the end of the 4096 cycle delay, the rst signal will remain in the reset condition until the other reset condition(s) end. por will not activate the pulldown device on the reset pin. v dd must drop below v por in order for the internal por circuit to detect the next rise of v dd . 5.3.2 computer operating properly (cop) reset the cop watchdog system consist of a divide by 8 counter with clock source from the 8-bit timer (timer8). hence, a cop watchdog time-out occurs on the 8th timer8 clock pulse. a cop watchdog time-out generates a cop reset to the cpu. figure 5-3 shows a block diagram of the cop watchdog logic. figure 5-3. cop watchdog block diagram the cop watchdog is part of a software error detection system and must be cleared periodically to start a new time-out period. to clear the cop watchdog and prevent a cop reset, write a logic 1 to the copc bit in the cop register at location $1ff0. the cop register, shown in figure 5-4 , is a write-only register that returns the content of a rom location when read. copc ?cop clear copc is a write-only bit. periodically writing a logic one to copc prevents the cop watchdog from resetting the mcu. reset clears the copc bit. 1 = reset cop watchdog timer. 0 = no effect on cop watchdog timer. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 copr r $1ff0 w copc reset uuuuuuuu figure 5-4. cop watchdog register (copr) s latch r copon from timer8 counter ? 8 counter cop reset to reset logic write 1 to copc r logic from reset logic f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 resets mc68hc05pl4 5-4 rev 2.0 use the following formula to calculate the cop time-out period: cop time-out period = (prescaler x 256 x 8) ? f bus where prescaler is the timer8 prescaler value the clock input to the watchdog system is derived from the output of the timer8, therefore a reset or preset of timer8 may affect the cop watchdog time-out period. the cop watchdog reset will assert the pulldown device to pull the reset pin low for 3-4 cycles of the internal bus clock. the cop reset can be enable or disable by the copon bit in miscr. the miscr is in figure 5-5 . copon ?cop on since the cop watchdog system is derived from the 8-bit timer system, the t8en bit in the timer8 control and status register (bit3 of $0d) must be set for copon bit to have any affect. copon can be set to enable the cop watchdog system. once set, the watch- dog system cannot be disabled other than by a power-on reset or external reset. after a reset the copon bit is cleared and the cop watchdog system is disabled. 1 = cop watchdog enabled. 0 = cop watchdog disabled. note the cop watchdog system is not designed to operate in stop mode, therefore it should be disabled before entering stop mode by clearing the copon bit. entering stop mode with cop watchdog enabled will cause an internal reset of the mcu. 5.3.3 illegal address reset an opcode fetch from an address that is not in the rom (locations $0e00C$1dff and $1ff0-$1fff) or the ram (locations $0020C$011f) generates an illegal address reset. the illegal address reset will assert the pulldown device to pull the reset pin low for 3-4 cycles of the internal bus clock. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 micsr r irqen irqs tcmpen tcapen led copon por $001c w reset 00000000 figure 5-5. miscellaneous control and status register (micsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 resets rev 2.0 5-5 5.4 reset states of subsystem in mcu the following paragraphs describe how a reset initializes various sub-systems. 5.4.1 cpu a reset has the following effects on the cpu: ? loads the stack pointer with $ff. ? sets the i bit in the condition code register, inhibiting interrupts. ? loads the program counter with the user de ned reset vector from locations $1ffe and $1fff. ? clears the stop latch, enabling the cpu clock. ? clears the wait latch, bringing the cpu out of the wait mode. 5.4.2 i/o registers a reset has the following effects on i/o registers: ? clears bits in data direction registers con gur ing pins as inputs: C ddra6Cddra0 in ddra for port a. C ddrb7Cddrb0 in ddrb for port b. C ddrc7Cddrc0 in ddrc for port c. ? has no effect on port a, b, c data registers. 5.4.3 8-bit timer a reset has the following effects on the 8-bit timer: ? timer 8 system disabled (t8en bit cleared) ? timer 8 interrupt request disabled ? timer 8 pre-scalar preset to divide the internal bus clock by ratio 16 ? timer 8 counter register preset to $ff therefore disables the timer 8 interrupt and preset the counter for por cycle delay. 5.4.4 16-bit programmable timer a reset has the following effects on the 16-bit programmable timer: ? initializes the timer counter registers (tmrh, tmrl) to a value of $fffc. ? initializes the alternate timer counter registers (acrh, acrl) to a value of $fffc. ? clears all the interrupt enables and the output level bit (olvl) in the timer control register (tcr). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 resets mc68hc05pl4 5-6 rev 2.0 ? does not affect the input capture edge bit (iedg) in the tcr. ? does not affect the interrupt ags in the timer status register (tsr). ? does not affect the input capture registers (icrh, icrl). ? does not affect the output compare registers (ocrh, ocrl). therefore con gure the por t a pins pa2,pa3 as general i/o function. however the timer is free running for interrupt process. 5.4.5 keyboard interrupt interface a reset has the following effects on the keyboard interrupt interface: ? clears all bits in keyboard interrupt enable register (kier) and keyboard interrupt disable ? clears all bits in keyboard interrupt ag register (kifr) ? clears all bits in pull-up enable register (puer) therefore disables the keyboard interrupt and leaves the shared port b pins as general i/o. any pending interrupt ag is cleared and the k eyboard interrupt is dis- abled. 5.4.6 6-bit dac subsystem a reset has the following effects on the dac subsystem: ? clears all bits in dac control register, hence dac subsystem is disabled. therefore con gure the por t a pin pa1 as general i/o function. 5.4.7 system clock option subsystem at reset has the following effects on osc clock subsystem ? the internal rc is enabled and oscillating at around 500khz ? internal clock divider selected to divide by 2 for bus frequency 5.4.8 miscellaneous subsystem a p reset has the following effects on irq subsystem ? irq is disabled and reset the irq selection as negative edge-triggered and low level-triggered, hence the led/irq pin function as led output pin therefore also disable the led driver output, hence the led/irq pin is in high impedance state. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 resets rev 2.0 5-7 5.5 reset characteristics table 5-1. reset characteristics figure 5-6. stop recovery timing diagram characteristic symbol min typ max unit por recovery voltage 2 v por 0 100 mv por v dd slew rate 2 rising 2 falling 2 s vddr s vddf 0.1 0.05 v/ms v/ms reset pulse width (when bus clock active) t rl 1.5 t cyc reset pulldown pulse width (from internal reset) t rpd 34t cyc note: 1. +2.0 v dd +4.0 v, v ss = 0 v, t l t a t h , unless otherwise noted 2. by design, not tested. pch new 1ffe t rl osc1 1 reset internal clock 3 internal address bus 3 4096 notes: 1. represents the internal gating of the osc1 pin 2. normal delay of 4064 t cyc 3. internal timing signal and data information not available externally. internal data bus 3 1fff new pch new pcl pcl new code o p f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 resets mc68hc05pl4 5-8 rev 2.0 figure 5-7. internal reset timing diagram pch new 1ffe t rpd reset internal clock 3 internal address bus 3 4096 notes: 1. represents the internal reset from low voltage reset, illegal opcode fetch or cop watchdog timeout. 2. normal delay of 4064 t cyc 3. internal timing signal and data information not available externally. internal data bus 3 1fff new pch new pcl pcl new internal reset 1 p in f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 operating modes rev 2.0 6-1 section 6 operating modes this section describes the various operating modes of the mc68hc05pl4. 6.1 operating modes the mc68hc05pl4 has two operating modes: single-chip (normal) mode and self-check mode. at the rising edge of the reset , the device latches the states of led/irq and pb0/kbi0 pins and places itself in the speci ed mode . reset must be held low for the prede ned po wer-on reset cycles of the internal ph2 clock after por, or for a time t rl for any other reset. the conditions required to enter each mode are shown in table 6-1 . the mode of operation is determined by the voltages on the led/irq and pb0/kbi0 pins on the rising edge of the external reset pin. 6.1.1 single-chip (normal) mode the single-chip mode is the normal operating mode, and it allows the device to function as a self-contained microcontroller, with maximum use of the pins for on- chip peripheral functions. in the single-chip mode all address and data activity occurs within the mcu and is not available externally. single-chip mode is entered if the led/irq pin is within the normal operating voltage range when the rising edge of a reset occurs. in single-chip mode, all i/o port pins are available. 6.1.2 self-check mode the self-check program is mask at location $1e00 to $1fef, and is used for checking device functionality under minimum hardware support. table 6-1. operation mode condition after reset reset pin led/irq pb0/kbi0 mode v ss to v dd v ss to v dd single-chip (normal) v tst v dd self-check v tst = 2 x v dd f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 operating modes mc68hc05pl4 6-2 rev 2.0 6.2 low power modes in each of its con gur ation modes the mc68hc05pl4 is capable of running in one of two low-power operating modes. the wait and stop instructions provide two modes that reduce the power required for the mcu by stopping various internal clocks and/or the oscillator. the o w of the stop, and wait modes are shown in figure 6-1 . 6.2.1 stop mode execution of the stop instruction places the mcu in its lowest power consumption mode. the mcu can exit from the stop by an irq or keyboard interrupt (kbix), or an externally generated reset. when exiting the stop mode the internal oscillator will resume after 4064 internal processor clock cycles oscillator stabilization delay. 6.2.2 wait mode the wait instruction places the mcu in a low-power mode, which consumes more power than the stop mode. the wait mode may be exited by an external irq , a keyboard interrupt, 16-bit timer interrupt, 8-bit timer interrupt, or by an external reset . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 operating modes rev 2.0 6-3 figure 6-1. stop/wait flowchart 1. fetch reset vector or 2. service interrupt a. stack b. set i-bit c. vector to interrupt routine wait external reset ? y n irq external interrupt? y n stop external oscillator, stop internal timer clock, reset start-up delay restart external oscillator, start stabilization delay stop internal processor clock, clear i-bit in ccr, and set irqen in micsr end of stabilization delay? y n irq external interrupt? y n external oscillator active and internal timer clock active restart internal processor clock 8-bit timer interrupt? y n external reset ? y n stop stop internal processor clock, clear i-bit in ccr, and set irqen in micsr 16-bit timer interrupt? y n keyboard interrupt? y n keyboard interrupt? y n f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 operating modes mc68hc05pl4 6-4 rev 2.0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 input/output ports rev 2.0 7-1 section 7 input/output ports this section describes the general purpose i/o ports on the mc68hc05pl4 and mc68HC05PL4B mcus. in the mc68hc05pl4, 23 bidirectional i/o lines are available, arranged as one 7-bit i/o port (port a), one 8-bit i/o port (port b), and one 8-bit i/o port (port c). in the mc68HC05PL4B, 22 bidirectional i/o lines are available, arranged as one 6-bit i/o port (port a), one 8-bit i/o port (port b), and one 8-bit i/o port (port c). note to avoid generating a glitch on an i/o port pin, data should be written to the i/o port data register before writing a 1 (for output) to the corresponding data direction register. 7.1 parallel ports port a, b, and c are bidirectional ports. each port pin is controlled by the corresponding bits in a data direction register and a data register as shown in figure 7-1 . the functions of the i/o pins are summarized in table 7-1 . figure 7-1. port input/output circuitry i/o pin output reset (rst) read data write data read/write ddr internal data bus data direction register bit data register bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 input/output ports mc68hc05pl4 7-2 rev 2.0 table 7-1. i/o pin functions 7.1.1 port data registers each port i/o pin has a corresponding bit in the port data register. when a port i/o pin is programmed as an output the state of the corresponding data register bit determines the state of the output pin. when a port pin is programmed as an input, any read of the port data register will return the logic state of the corresponding i/o pin. the locations of the data registers for port a, b, and c are at $0000, $0001 and $0002. the port data registers are unaffected by reset. 7.1.2 port data direction registers each port i/o pin may be programmed as an input by clearing the corresponding bit in the ddr, or programmed as an output by setting the corresponding bit in the ddr. the ddr for port a, b, and c are located at $0005, $0006 and $0007. the ddrs are cleared by reset. note a glitch can be generated on an i/o pin when changing it from an input to an output unless the data register is rst preconditioned to the desired state bef ore changing the corresponding ddr bit from a zero to a one. 7.2 port a port a is an 7-bit bidirectional port, with pins shared with other modules. the port a data register is at address $0000 and the data direction register is at address $0005. port pins pa5 and pa6 are high current sink pins; see electrical speci cations section f or values. pin pa0 is only available on mc68hc05pl4. osc2 replaces pa0 on mc68HC05PL4B. pin pa1 becomes the dtmf output from the dac when the dacen bit is set in the dac control and data register ($000f). pins pa2 and pa3 become the 16-bit timer tcap and tcmp respectively, when tcapen and tcmpen are set in the miscellaneous control/status register ($001c). r/w ddr i/o pin functions 0 0 the i/o pin is in input mode. data is written into the output data latch. 0 1 data is written into the output data latch and output to the i/o pin. 1 0 the state of the i/o pin is read. 1 1 the i/o pin is in an output mode. the output data latch is read. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 input/output ports rev 2.0 7-3 7.3 port b port b is an 8-bit bidirectional port, with pins pb0-pb3 shared with keyboard inter- rupt functions. the port b data register is at address $0001 and the data direc- tion register is at address $0006. pins pb0 to pb3 keyboard interrupt functions have individual enable and ag bits in registers $000b and $000c. 7.4 port c port c is an 8-bit bidirectional port. the port c data register is at address $0002 and the data direction register is at address $0007. port pins pc0 to pc3 are high current sink pins; see electrical speci cations section f or values. 7.5 summary of port a and port b shared pins table 7-2 below shows a summary of port pins shared with other on-chip mod- ules. table 7-2. port a and port b shared pins port port pin control pin name shared functions port a pa0 pa0 or osc2 pa0 on mc68hc05pl4 osc2 on mc68HC05PL4B pa1 dacen pa1/dtmf dac dtmf output pa2 tcapen pa2/tcap 16-bit timer input capture pa3 tcmpen pa3/tcmp 16-bit timer output compare port b pb3-pb0 kbie3-kbie0 pul3-pul0 pb3/kbi3-pb0/kbi0 keyboard interrupt f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 input/output ports mc68hc05pl4 7-4 rev 2.0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 system clocks rev 2.0 8-1 section 8 system clocks this section describes the system clock options for the mc68hc05pl4. 8.1 system clock source and frequency option the operating bus frequency of the mcu is dependent on the clock source (osc1 or internal rc) and the clock divider ratio. these are selected in the system clock control register (syscr). sysdiv1,sysdiv2 ?system clock divider select the sysdiv1 and sysdiv2 bits select the divide ratio for the clock source. after power-on-reset, the default setting is divide by 2. table 8-1 shows the divide ratios. cksel1,cksel2 ?system clock source select the cksel1 and cksel2 bits select the system clock source for the mcu. after power-on-reset, the default setting is internal rc. table 8-2 shows the system clock source options. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 syscr r sysdiv1 sysdiv2 cksel1 cksel2 fmode oscf rcf ckosc $001d w por00101010 figure 8-1. system clock control register (syscr) table 8-1. system clock divider select sysdiv1 sysdiv2 div 00 2 01 4 10 8 11 16 table 8-2. system clock source select cksel1 cksel2 select option 0 0 external from osc1 0 1 external from osc1 1 0 internal rc 1 1 external from osc1 (with rc enabled) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 system clocks mc68hc05pl4 8-2 rev 2.0 fmode ?fast mode rc select fmode selects the oscillating frequency of the internal rc. after power-on- reset, the default setting is 500khz. 1 = internal rc oscillates at 500khz 0 = internal rc oscillates at 20khz oscf ?osc running flag this bit is set when the external clock (external/crystal) from osc1 is on. see also ckosc bit below. rcf ?rc running flag this bit is set when the internal rc clock is on. ckosc ?check osc the ckosc bit enables the internal logic for external clock selection. the pro- cedure below should be followed when switching from rc to external clock. 1. set the cksel1 and cksel2 bits for external clock source. 2. if crystal option is used set the 8-bit timer for counting crystal stabilization delay (typically 4064 clock cycles). 3. write a 1 to the ckosc bit and check for oscf bit set. 4. if the oscf bit is not set, no external clock is available, the internal rc clock will be used as the system clock, irrespective of the setting for cksel1 and cksel2. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 16-bit programmable timer rev 2.0 9-1 section 9 16-bit programmable timer the mc68hc05pl4 mcu contains a 16-bit programmable timer with an input capture function and an output compare function as shown by the block diagram in figure 9-1 . figure 9-1. programmable timer block diagram iedg olvl icie ocie toie tmrh ($0018) tmrl ($0019) 16-bit counter ? 4 internal (xtal ? 2) timer control register timer request overflow (tof) reset clock interrupt acrh ($001a) acrl ($001b) 16-bit comparator ocrh ($0016) ocrl ($0017) pa2 tcap edge select & detect icf ocf tof timer status register iedg icf ocf olvl $0012 $0013 internal data bus logic icrh ($0014) icrl ($0015) d c q pa3 tcmp f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 16-bit programmable timer mc68hc05pl4 9-2 rev 2.0 the basis of the capture/compare timer is a 16-bit free-running counter which increases in count with each internal bus clock cycle. the counter is the timing ref- erence for the input capture and output compare functions. the input capture and output compare functions provide a means to latch the times at which external events occur, to measure input waveforms, and to generate output waveforms and timing delays. software can read the value in the 16-bit free-running counter at any time without affect the counter sequence. because of the 16-bit timer architecture, the i/o registers for the input capture and output compare functions are pairs of 8-bit registers. each register pair contains the high and low byte of that function. generally, accessing the low byte of a spe- ci c timer function allo ws full control of that function; however, an access of the high byte inhibits that speci c timer function until the lo w byte is also accessed. because the counter is 16 bits long and preceded by a x ed divide-by-four pres- caler, the counter rolls over every 262,144 internal clock cycles. timer resolution with a 4 mhz crystal oscillator is 2 microsecond/count. the interrupt capability, the input capture edge, and the output compare state are controlled by the timer control register (tcr) located at $0012 and the status of the interrupt ags can be read from the timer status register (tsr) located at $0013. 9.1 timer registers (tmrh, tmrl) the functional block diagram of the 16-bit free-running timer counter and timer registers is shown in figure 9-2 . the timer registers include a transparent buffer latch on the lsb of the 16-bit timer counter. figure 9-2. timer counter and register block diagram toie tmrh ($0018) tmr lsb 16-bit counter ? 4 internal (xtal ? 2) timer control reg. timer request overflow (tof) reset clock interrupt tmrl ($0019) tof timer status reg. $0012 $0013 internal ($fffc) data read tmrh read tmrl read latch bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 16-bit programmable timer rev 2.0 9-3 the timer registers (tmrh, tmrl) shown in figure 9-3 are read-only locations which contain the current high and low bytes of the 16-bit free-running counter. writing to the timer registers has no effect. reset of the device presets the timer counter to $fffc. the tmrl latch is a transparent read of the lsb until the a read of the tmrh takes place. a read of the tmrh latches the lsb into the tmrl location until the tmrl is again read. the latched value remains x ed even if multiple reads of the tmrh take place before the next read of the tmrl. therefore, when reading the msb of the timer at tmrh the lsb of the timer at tmrl must also be read to complete the read sequence. during power-on-reset (por), the counter is initialized to $fffc and begins counting after the oscillator start-up delay. because the counter is sixteen bits and preceded by a xed divide-by-four prescaler, the value in the counter repeats every 262, 144 internal bus clock cycles (524, 288 oscillator cycles). when the free-running counter rolls over from $ffff to $0000, the timer over o w ag bit (t of) is set in the tsr. when the tof is set, it can generate an interrupt if the timer over o w interrupt enable bit (toie) is also set in the tcr. the tof ag bit can only be reset by reading the tmrl after reading the tsr. other than clearing any possible tof ags , reading the tmrh and tmrl in any order or any number of times does not have any effect on the 16-bit free-running counter. note to prevent interrupts from occurring between readings of the tmrh and tmrl, set the i bit in the condition code register (ccr) before reading tmrh and clear the i bit after reading tmrl. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmrh r tmrh7 tmrh6 tmrh5 tmrh4 tmrh3 tmrh2 tmrh1 tmrh0 $0018 w reset: 11111111 tmrl r tmrl7 tmrl6 tmrl5 tmrl4 tmrl3 tmrl2 tmrl1 tmrl0 $0019 w reset: 11111100 figure 9-3. programmable timer registers (tmrh, tmrl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 16-bit programmable timer mc68hc05pl4 9-4 rev 2.0 9.2 alternate counter registers (acrh, acrl) the functional block diagram of the 16-bit free-running timer counter and alternate counter registers is shown in figure 9-4 . the alternate counter registers behave the same as the timer registers, except that any reads of the alternate counter will not have any effect on the tof ag bit and timer interrupts. the alternate counter registers include a transparent buffer latch on the lsb of the 16-bit timer counter. figure 9-4. alternate counter block diagram the alternate counter registers (acrh, acrl) shown in figure 9-5 are read-only locations which contain the current high and low bytes of the 16-bit free-running counter. writing to the alternate counter registers has no effect. reset of the device presets the timer counter to $fffc. the acrl latch is a transparent read of the lsb until the a read of the acrh takes place. a read of the acrh latches the lsb into the acrl location until the acrl is again read. the latched value remains x ed even if multiple reads of the acrh take place before the next read of the acrl. therefore, when reading the msb of the timer at acrh the lsb of the timer at acrl must also be read to complete the read sequence. during power-on-reset (por), the counter is initialized to $fffc and begins counting after the oscillator start-up delay. because the counter is sixteen bits and preceded by a xed divide-by-four prescaler, the value in the counter repeats every 262,144 internal bus clock cycles (524,288 oscillator cycles). reading the acrh and acrl in any order or any number of times does not have any effect on the 16-bit free-running counter or the tof ag bit. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 acrh r acrh7 acrh6 acrh5 acrh4 acrh3 acrh2 acrh1 acrh0 $001a w reset: 11111111 acrl r acrl7 acrl6 acrl5 acrl4 acrl3 acrl2 acrl1 acrl0 $001b w reset: 11111100 figure 9-5. alternate counter registers (acrh, acrl) acrh ($001a) tmr lsb 16-bit counter ? 4 internal (xtal ? 2) reset clock acrl ($001b) internal ($fffc) data read acrh read acrl read latch bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 16-bit programmable timer rev 2.0 9-5 note to prevent interrupts from occurring between readings of the acrh and acrl, set the i bit in the condition code register (ccr) before reading acrh and clear the i bit after reading acrl. 9.3 input capture registers the input capture function is a technique whereby an external signal (connected to pa2/tcap pin) is used to trigger the 16-bit timer counter. in this way it is possi- ble to relate the timing of an external signal to the internal counter value, and hence to elapsed time. when the input capture circuitry detects an active edge on the selected source, it latches the contents of the free-running timer counter registers into the input cap- ture registers as shown in figure 9-6 . latching values into the input capture registers at successive edges of the same polarity measures the period of the selected input signal. latching the counter val- ues at successive edges of opposite polarity measures the pulse width of the sig- nal. figure 9-6. timer input capture block diagram the input capture registers are made up of two 8-bit read-only registers (icrh, icrl) as shown in figure 9-7 . the input capture edge detector contains a schmitt trigger to improve noise immunity. the edge that triggers the counter transfer is de ned b y the input edge bit (iedg) in the tcr. reset does not affect the con- tents of the input capture registers. icie icrh ($0014) 16-bit counter ? 4 internal (xtal ? 2) timer control reg. timer request input capture (icf) reset clock interrupt icrl ($0015) icf timer status reg. $0012 $0013 internal ($fffc) data read icrh read icrl latch bus iedg edge select & detect logic iedg tcap internal data bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 16-bit programmable timer mc68hc05pl4 9-6 rev 2.0 the result obtained by an input capture will be one count higher than the value of the free-running timer counter preceding the external transition. this delay is required for internal synchronization. resolution is affected by the prescaler, allowing the free-running timer counter to increment once every four internal clock cycles (eight oscillator clock cycles). reading the icrh inhibits further captures until the icrl is also read. reading the icrl after reading the timer status register (tsr) clears the icf ag bit. does not inhibit transfer of the free-running counter. there is no con ict betw een read- ing the icrl and transfers from the free-running timer counters. the input capture registers always contain the free-running timer counter value which corresponds to the most recent input capture. note to prevent interrupts from occurring between readings of the icrh and icrl, set the i bit in the condition code register (ccr) before reading icrh and clear the i bit after reading icrl. 9.4 output compare registers the output compare function is a means of generating an output signal when the 16-bit timer counter reaches a selected value as shown in figure 9-8 . software writes the selected value into the output compare registers. on every fourth inter- nal clock cycle (every eight oscillator clock cycle) the output compare circuitry compares the value of the free-running timer counter to the value written in the output compare registers. when a match occurs, the timer transfers the output level (olvl) from the timer control register (tcr) to the tcmp. software can use the output compare register to measure time periods, to gener- ate timing delays, or to generate a pulse of speci c duration or a pulse train of speci c frequency and duty cycle on the tcmp. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icrh r icrh7 icrh6 icrh5 icrh4 icrh3 icrh2 icrh1 icrh0 $0014 w reset: uuuuuuuu icrl r icrl7 icrl6 icrl5 icrl4 icrl3 icrl2 icrl1 icrl0 $0015 w reset: uuuuuuuu u = unaffected by reset figure 9-7. input capture registers (icrh, icrl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 16-bit programmable timer rev 2.0 9-7 the planned action on the tcmp depends on the value stored in the olvl bit in the tcr, and it occurs when the value of the 16-bit free-running timer counter matches the value in the output compare registers shown in figure 9-3 . these registers are read/write bits and are unaffected by reset. writing to the ocrh before writing to the ocrl inhibits timer compares until the ocrl is written. reading or writing to the ocrl after reading the tcr will clear the output compare ag bit (ocf). the output compare olvl state will be clocked to its output latch regardless of the state of the ocf. figure 9-8. timer output compare block diagram to prevent ocf from being set between the time it is read and the time the output compare registers are updated, use the following procedure: 1. disable interrupts by setting the i bit in the condition code register. 2. write to the ocrh. compares are now inhibited until ocrl is written. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ocrh r ocrh7 ocrh6 ocrh5 ocrh4 ocrh3 ocrh2 ocrh1 ocrh0 $0016 w reset: uuuuuuuu ocrl r ocrl7 ocrl6 ocrl5 ocrl4 ocrl3 ocrl2 ocrl1 ocrl0 $0017 w reset: uuuuuuuu u = unaffected by reset figure 9-9. output compare registers (ocrh, ocrl) ocie ocrh ($0016) 16-bit counter ? 4 internal (xtal ? 2) timer control reg. timer request output compare reset clock interrupt ocrl ($0017) ocf timer status reg. $0012 $0013 internal ($fffc) data r/w ocrh r/w ocrl bus olvl edge select detect logic olvl 16-bit comparator (ocf) tcmp f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 16-bit programmable timer mc68hc05pl4 9-8 rev 2.0 3. read the tsr to arm the ocf for clearing. 4. enable the output compare registers by writing to the ocrl. this also clears the ocf ag bit in the tsr. 5. enable interrupts by clearing the i bit in the condition code register. a software example of this procedure is shown in table 9-1 . 9.5 timer control register (tcr) the timer control register shown in figure 9-10 performs the following functions: ? enables input capture interrupts. ? enables output compare interrupts. ? enables timer over o w interrupts. ? con gure the i/o p ort pin pa2 as input pin for tcap signal ? con gure the i/o p ort pin pa3 as output pin for tcmp signal ? control the active edge polarity of the tcap signal. ? controls the active level of the tcmp output. reset clears all the bits in the tcr with the exception of the iedg bit which is unaffected. icie - input capture interrupt enable this read/write bit enables interrupts caused by an active signal on the pb1/ tcap pin or from cpf2 ag bit of the analog subsystem v oltage comparator 2. reset clears the icie bit. 1 = input capture interrupts enabled. 0 = input capture interrupts disabled. table 9-1. output compare initialization example 9b ... ... b7 b6 bf ... ... 9a 16 13 17 sei ... ... sta lda stx ... ... cli ocrh tsr ocrl disable interrupts ..... ..... inhibit output compare arm ocf flag for clearing ready for next compare, ocf cleared ..... ..... enable interrupts bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tcr r icie ocie toie 000 iedg olvl $0012 w reset: 000000u0 figure 9-10. timer control register (tcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 16-bit programmable timer rev 2.0 9-9 ocie - output compare interrupt enable this read/write bit enables interrupts caused by an active signal on the tcmp pin. reset clears the ocie bit. 1 = output compare interrupts enabled. 0 = output compare interrupts disabled. toie - timer overflow interrupt enable this read/write bit enables interrupts caused by a timer over o w. reset clears the toie bit. 1 = timer over o w interrupts enabled. 0 = timer over o w interrupts disabled. iedg - input capture edge select the state of this read/write bit determines whether a positive or negative transi- tion on the tcap pin triggers a transfer of the contents of the timer register to the input capture register. resets have no effect on the iedg bit. 1 = positive edge (low to high transition) triggers input capture. 0 = negative edge (high to low transition) triggers input capture. olvl - output compare output level select the state of this read/write bit determines whether a logic one or a logic zero appears on the tcmp when a successful output compare occurs. resets clear the olvl bit. 1 = tcmp goes high on output compare. 0 = tcmp goes low on output compare. 9.5.1 miscellaneous control and status register for timer16 the miscellaneous control and status register shown in figure 9-11 performs the following functions: ? con gure the i/o por t pin pa2 as input pin for tcap signal ? con gure the i/o por t pin pa3 as output pin for tcmp signal tcapen - timer input capture enable the bit con gures por t pin pa2 for timer16 input capture function (tcap). at power-on-reset, this bit is cleared, pa2 is a standard i/o port pin, tcap to the timer16 is pulled high. 1 = pa2 pin con gured as tcap for timer input capture 0 = pa2 pin as standard i/o port pin bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 micsr r irqen irqs tcmpen tcapen 0 led copon por $001c w reset: 00000001 figure 9-11. miscellaneous control and status register (miscr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 16-bit programmable timer mc68hc05pl4 9-10 rev 2.0 tcmpen - timer output compare enable the bit con gures por t pin pa3 for timer16 output compare function (tcmp). at power-on-reset, this bit is cleared, pa3 is a standard i/o port pin, tcmp sig- nal to pa3 is disabled from timer16. 1 = pa3 pin con gured as tcmp for timer output compare 0 = pa3 pin as standard i/o port pin 9.6 timer status register (tsr) the timer status register (tsr) shown in figure 9-12 contains ags f or the follow- ing events: ? an active signal on the pa2/tcap pin transferring the contents of the timer registers to the input capture registers. ? a match between the 16-bit counter and the output compare registers, transferring the olvl bit to the tcmp. ? an over o w of the timer registers from $ffff to $0000. writing to any of the bits in the tsr has no effect. reset does not change the state of any of the ag bits in the tsr. icf - input capture flag the icf bit is automatically set when an edge of the selected polarity occurs on the pa2/tcap pin. clear the icf bit by reading the timer status register with the icf set, and then reading the low byte (icrl, $0015) of the input capture registers. resets have no effect on icf. ocf - output compare flag the ocf bit is automatically set when the value of the timer registers matches the contents of the output compare registers. clear the ocf bit by reading the timer status register with the ocf set, and then accessing the low byte (ocrl, $0017) of the output compare registers. resets have no effect on ocf. tof - timer overflow flag the tof bit is automatically set when the 16-bit timer counter rolls over from $ffff to $0000. clear the tof bit by reading the timer status register with the tof set, and then accessing the low byte (tmrl, $0019) of the timer registers. resets have no effect on tof. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tsrricfocftof00000 $0013 w reset: u u u 00000 u = unaffected by reset figure 9-12. timer status registers (tsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 16-bit programmable timer rev 2.0 9-11 9.7 16-bit timer operation during wait mode during wait mode the 16-bit timer continues to operate normally and may gener- ate an interrupt to trigger the mcu out of the wait mode. 9.8 16-bit timer operation during stop mode when the mcu enters the stop mode the free-running counter stops counting (the internal processor clock is stopped). it remains at that particular count value until the stop mode is exited by applying a low signal to the irq pin, at which time the counter resumes from its stopped value as if nothing had happened. if stop mode is exited via an external reset (logic low applied to the reset pin) the counter is forced to timer interrupt vector. if a valid input capture edge occurs at the pa2/tcap pin during the stop mode the input capture detect circuitry will be armed. this action does not set any ags or wake up the mcu, but when the mcu does wake up there will be an active input capture ag (and data) from the rst v alid edge. if the stop mode is exited by an external reset, no input capture ag or data will be present e ven if a valid input capture edge was detected during the stop mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 16-bit programmable timer mc68hc05pl4 9-12 rev 2.0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 8-bit timer rev 2.0 10-1 section 10 8-bit timer this section describes the 8-bit count down timer module. 10.1 overview figure 10-1. timer8 block diagram as shown in figure 10-1 this timer contains a single 8-bit software programmable countdown timer counter with a 3-bit software control prescaler. the counters value may be preset under software control and counts down to zero. when the counter decrements to zero, the timer8 interrupt request bit (t8if in t8cr) is set. then if the timer interrupt is enabled (t8ie in t8cr is set) and the i-bit of the con- dition code register are is cleared, the processor receives an interrupt. after com- pletion of the current instruction, the processor proceeds to store the appropriate registers on the stack and then fetches the timer8 interrupt vector in order to begin serving the interrupt. interrupt circuit timer8 counter register ($0e) t8if t8ifr t8ie t8en ps2 ps1 ps0 timer8 control and status register ($0d) overflow detect circuit 8-bit count-down timer counter 7-bit prescaler counter prescaler select logic (8 to 1 mux) internal bus 8 8 8 8 internal bus clock to cop watchdog circuit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 8-bit timer mc68hc05pl4 10-2 rev 2.0 the counter continues to count after it reaches zero, allowing the software to determine the number of internal or external clocks since the timer interrupt request bit (t8if) was set. the counter may be read at any time by the processor without disturbing the count. the contents of the counter become stable prior to the read portion of a cycle and do not change during the read. the timer interrupt request bit (t8if) remains set until cleared by writing a 1 to the t8ifr bit in the t8cr. if writing to the timer 8 counter register (t8cntr) occurs before the timer interrupt is served, the interrupt is lost. the t8if bit may also be used as a scanned status bit in a non-interrupt mode of operation. the 3-bit control prescaler is a 7-bit divider which is used to extend the maximum length of the timer. bit 0, bit 1 and bit 2 (ps0, ps1 and ps2) of t8cr are pro- grammed to choose the appropriate prescaler output which is used as the counter input. 10.2 timer8 control and status register (t8csr) the t8csr at address $000d enables the software to control the operation of the 8-bit timer. t8if - timer8 interrupt flag t8if is set when timer8 counter register counts down to zero. a cpu interrupt request will be generated if t8ie is set. writing a "1" to the t8ifr bit clears the t8if bit. writing a "0" to this bit has no effect. reset clears t8if. 1 = timer8 has count down to zero 0 = timer8 has not count down to zero t8ifr - timer8 interrupt flag reset the t8ifr bit is a write-only bit, which clears the t8if ag b y writing 1 to this bit when the t8if bit is set. writing a "0" has no effect. reset does not affect this bit 1 = clear t8if ag bit 0 = no effect on t8if ag bit t8ie - interval timer interrupt enable when this bit is set, a cpu interrupt request is generated when the t8if bit is set. reset clears this bit. 1 = 8-bit timer interrupt enabled 0 = 8-bit timer interrupt disabled bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 t8csr r t8if 0 t8ie 0 t8en ps2 ps1 ps0 $000d w t8ifr reset: 00000100 figure 10-2. timer8 control and status register f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 8-bit timer rev 2.0 10-3 t8en - timer8 enable this read/write bit enables the timer8. reset clears this bit. 1 = timer8 enabled 0 = timer8 disabled ps2-ps0 - prescaler select these read/write bits is used to select the clock frequency to drive the 8-bit timer counter. the counter will be driven by a internal bus clock (e-clock) through this prescaler ratio. upon reset and power on reset, the value of prescaler is set to a default value of divided by 16. 10.3 timer8 counter register (t8cntr) the t8cntr is a read/write register which contains the current value of the 8-bit timer counter. reading this register enables the software to calculate the number of internal and external clocks since the timer interrupt request ag (t8if) was set. reading this address does not disturb the counter operation. note this timer is used during the power-on sequence to time out the por signal. the timer is con gured at po wer-on, with a prescaler division ratio of 16 and set to $ff in timer counter register. also the clock source for the cop watchdog system is derived from the output of this timer, hence a reset or preset of the prescaler and timer counter register may affect the frequency of the watchdog timeout. 10.4 computer operating properly (cop) watchdog please refer to section on resets for details. ps2 ps1 ps0 divide ratio 000 1 001 2 010 4 011 8 1 0 0 16 (default after reset) 101 32 110 64 111 128 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 t8cntr r timer 8 counter register $000e w reset: uuuuuuuu figure 10-3. timer8 counter register f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 8-bit timer mc68hc05pl4 10-4 rev 2.0 10.5 8-bit timer operation during wait mode the cpu clock halts during the wait mode, but the timer remains active. if the interrupts are enabled, the timer interrupt will cause the processor to exit the wait mode. 10.6 8-bit timer operation during stop mode the timer ceases counting in stop mode. when stop is exited by an external interrupt or an external reset, the internal oscillator will resume its operation, fol- lowed by internal processor stabilization delay. the timer is then cleared to zero and resumes its operation. note the t8if bit in t8csr will be set after mcu exit from stop mode. to avoid generation of the timer 8 interrupt when exiting stop mode, it is recommended to clear t8ie bit prior entering stop mode. after exiting stop mode t8if bit must be cleared before setting t8ie bit. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 digital to analog converter rev 2.0 11-1 section 11 digital to analog converter this section describes digital-to-analog module used for dtmf generation. 11.1 dac control and data register dacen - dac channel enable ths read/write bit enables/disables the dac module for dtmf output. 1 = enable dac module and con gure p a1/dtmf as dtmf output pin. 0 = disable dac module and con gure pa1/dtmf as general purpose pa1 pin. da5-da0 these bits determine the output voltage of the dac channel. the output volt- age value is determined by: v out = (v dd x da[0:5]) x 2 6 there are 64 evenly spaced voltage levels available between v dd and v ss . the lowest voltage is v ss and the highest voltage is 63/64v dd . 11.2 dac operation during wait mode in wait mode, the dac continues to output a x ed voltage level which is set by the da5-da0 bits. the dac should be disabled by clearing the dacen bit if fur- ther power saving is required in wait mode. 11.3 dac operation during stop mode in stop mode, the dac continues to output a x ed voltage level which is set by the da5-da0 bits. the dac should be disabled by clearing the dacen bit if fur- ther power saving is required in stop mode. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 dacdr r dacen 0 da5 da4 da3 da2 da1 da0 $000f w reset: 00000000 figure 11-1. dac control and data register f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 digital to analog converter mc68hc05pl4 11-2 rev 2.0 11.4 dac characteristics (v dd = 4.0v 10%, v ss = 0 v dc , t a = t l c to t h c, unless otherwise noted) characteristic symbol min max unit resolution 6 6 bits absolute accuracy 4.0v 2.0v v out v out 0 v dd /64 v dac output resistance r dac 7600 15600 w f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 instruction set rev 2.0 12-1 section 12 instruction set this section describes the addressing modes and instruction types. 12.1 addressing modes the cpu uses eight addressing modes for exibility in accessing data. the addressing modes de ne the manner in which the cpu nds the data required to execute an instruction. the eight addressing modes are the following: ? inherent ? immediate ? direct ? extended ? indexed, no offset ? indexed, 8-bit offset ? indexed, 16-bit offset ? relative 12.1.1 inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in the cpu registers, such as set carry ag (sec) and increment accumulator (inca). inherent instructions require no memory address and are one byte long. 12.1.2 immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instructions require no memory address and are two bytes long. the opcode is the rst b yte, and the immediate data value is the second byte. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 instruction set mc68hc05pl4 12-2 rev 2.0 12.1.3 direct direct instructions can access any of the rst 256 memor y addresses with two bytes. the rst b yte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address. brset and brclr are three-byte instructions that use direct addressing to access the operand and relative addressing to specify a branch destination. 12.1.4 extended extended instructions use only three bytes to access any address in memory. the rst b yte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the freescale assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction. 12.1.5 indexed, no offset indexed instructions with no offset are one-byte instructions that can access data with variable addresses within the rst 256 memor y locations. the index register contains the low byte of the conditional address of the operand. the cpu automatically uses $00 as the high byte, so these instructions can address locations $0000C$00ff. indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used ram or i/o location. 12.1.6 indexed, 8-bit offset indexed, 8-bit offset instructions are two-byte instructions that can access data with variable addresses within the rst 511 memor y locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the conditional address of the operand. these instructions can access locations $0000C$01fe. indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the rst 256 memory locations and could extend as far as location 510 ($01fe). the k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 instruction set rev 2.0 12-3 12.1.7 indexed, 16-bit offset indexed, 16-bit offset instructions are three-byte instructions that can access data with variable addresses at any location in memory. the cpu adds the unsigned byte in the index register to the two unsigned bytes following the opcode. the sum is the conditional address of the operand. the rst byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. these instructions can address any location in memory. indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. as with direct and extended addressing, the freescale assembler determines the shortest form of indexed addressing. 12.1.8 relative relative addressing is only for branch instructions. if the branch condition is true, the cpu nds the conditional branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, twos complement byte that gives a branching range of C128 to +127 bytes from the address of the next location after the branch instruction. when using the freescale assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and veri es that it is within the span of the branch. 12.1.9 instruction types the mcu instructions fall into the following v e categories: ? register/memory instructions ? read-modify-write instructions ? jump/branch instructions ? bit manipulation instructions ? control instructions f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 instruction set mc68hc05pl4 12-4 rev 2.0 12.1.10 register/memory instructions most of these instructions use two operands. one operand is in either the accumulator or the index register. the cpu nds the other oper and in memory. table 12-1 lists the register/memory instructions. table 12-1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 instruction set rev 2.0 12-5 12.1.11 read-modify-write instructions these instructions read a memory location or a register, modify its contents, and write the modi ed v alue back to the memory location or to the register. the test for negative or zero instruction (tst) is an exception to the read-modify-write sequence because it does not write a replacement value. table 12-2 lists the read-modify-write instructions. 12.1.12 jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump to subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. all branch instructions use relative addressing. bit test and branch instructions cause a branch based on the state of any readable bit in the rst 256 memor y locations. these three-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be tested is in the byte following the opcode. the third byte is the signed offset byte. the cpu nds the conditional br anch destination by adding the table 12-2. read-modify-write instructions instruction mnemonic arithmetic shift left asl arithmetic shift right asr clear bit in memory bclr set bit in memory bset clear clr complement (ones complement) com decrement dec increment inc logical shift left lsl logical shift right lsr negate (twos complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 instruction set mc68hc05pl4 12-6 rev 2.0 third byte to the program counter if the speci ed bit tests tr ue. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from C128 to +127 from the address of the next location after the branch instruction. the cpu also transfers the tested bit to the carry/borrow bit of the condition code register. table 12-3 lists the jump and branch instructions. table 12-3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 instruction set rev 2.0 12-7 12.1.13 bit manipulation instructions the cpu can set or clear any writable bit in the rst 256 b ytes of memory. port registers, port data direction registers, timer registers, and on-chip ram locations are in the rst 256 b ytes of memory. the cpu can also test and branch based on the state of any bit in any of the rst 256 memory locations. bit manipulation instructions use direct addressing. table 12-4 lists these instructions. 12.1.14 control instructions these register reference instructions control cpu operation during program execution. control instructions, listed in table 12-5 , use inherent addressing. table 12-4. bit manipulation instructions instruction mnemonic clear bit bclr branch if bit clear brclr branch if bit set brset set bit bset table 12-5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 instruction set mc68hc05pl4 12-8 rev 2.0 12.1.15 instruction set summary table 12-6 is an alphabetical list of all m68hc05 instructions and shows the effect of each instruction on the condition code register. table 12-6. instruction set summary source form operation description effect on ccr address mode opcode operand cycles h i nzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a ? (a) + (m) + (c) imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a ? (a) + (m) imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a ? (a) (m) imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bclr n opr clear bit n mn ? 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 beq rel branch if equal pc ? (pc) + 2 + rel ? z = 1 rel 27 rr 3 bhcc rel branch if half-carry bit clear pc ? (pc) + 2 + rel ? h = 0 rel 28 rr 3 c b0 b7 0 b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 instruction set rev 2.0 12-9 bhcs rel branch if half-carry bit set pc ? (pc) + 2 + rel ? h = 1 rel 29 rr 3 bhi rel branch if higher pc ? (pc) + 2 + rel ? c z = 0 rel 22 rr 3 bhs rel branch if higher or same pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bih rel branch if irq pin high pc ? (pc) + 2 + rel ? irq = 1 rel 2f rr 3 bil rel branch if irq pin low pc ? (pc) + 2 + rel ? irq = 0 rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff p 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 bls rel branch if lower or same pc ? (pc) + 2 + rel ? c z = 1 rel 23 rr 3 bmc rel branch if interrupt mask clear pc ? (pc) + 2 + rel ? i = 0 rel 2c rr 3 bmi rel branch if minus pc ? (pc) + 2 + rel ? n = 1 rel 2b rr 3 bms rel branch if interrupt mask set pc ? (pc) + 2 + rel ? i = 1 rel 2d rr 3 bne rel branch if not equal pc ? (pc) + 2 + rel ? z = 0 rel 26 rr 3 bpl rel branch if plus pc ? (pc) + 2 + rel ? n = 0 rel 2a rr 3 bra rel branch always pc ? (pc) + 2 + rel ? 1 = 1 rel 20 rr 3 brclr n opr rel branch if bit n clear pc ? (pc) + 2 + rel ? mn = 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brset n opr rel branch if bit n set pc ? (pc) + 2 + rel ? mn = 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc ? (pc) + 2 + rel ? 1 = 0 rel 21 rr 3 table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 instruction set mc68hc05pl4 12-10 rev 2.0 bset n opr set bit n mn ? 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc ? (pc) + 2; push (pcl) sp ? (sp) C 1; push (pch) sp ? (sp) C 1 pc ? (pc) + rel rel ad rr 6 clc clear carry bit c ? 0 0 inh 98 2 cli clear interrupt mask i ? 0 0 inh 9a 2 clr opr clra clrx clr opr ,x clr ,x clear byte m ? $00 a ? $00 x ? $00 m ? $00 m ? $00 0 1 dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) C (m) imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (ones complement) m ? ( ) = $ff C (m) a ? ( ) = $ff C (m) x ? ( ) = $ff C (m) m ? ( ) = $ff C (m) m ? ( ) = $ff C (m) 1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) C (m) 1 imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m ? (m) C 1 a ? (a) C 1 x ? (x) C 1 m ? (m) C 1 m ? (m) C 1 dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a ? (a) ? (m) imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc m a x m m f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 instruction set rev 2.0 12-11 inc opr inca incx inc opr ,x inc ,x increment byte m ? (m) + 1 a ? (a) + 1 x ? (x) + 1 m ? (m) + 1 m ? (m) + 1 dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc ? jump address dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc ? (pc) + n (n = 1, 2, or 3) push (pcl); sp ? (sp) C 1 push (pch); sp ? (sp) C 1 pc ? conditional address dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a ? (m) imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x ? (m) imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right 0 dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a ? (x) (a) 0 0 inh 42 11 neg opr nega negx neg opr ,x neg ,x negate byte (twos complement) m ? C(m) = $00 C (m) a ? C(a) = $00 C (a) x ? C(x) = $00 C (x) m ? C(m) = $00 C (m) m ? C(m) = $00 C (m) dir inh inh ix1 ix 30 40 50 60 70 ii ff 5 3 3 6 5 nop no operation inh 9d 2 table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc c b0 b7 0 b0 b7 c 0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 instruction set mc68hc05pl4 12-12 rev 2.0 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a ? (a) (m) imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp ? $00ff inh 9c 2 rti return from interrupt sp ? (sp) + 1; pull (ccr) sp ? (sp) + 1; pull (a) sp ? (sp) + 1; pull (x) sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 80 6 rts return from subroutine sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a ? (a) C (m) C (c) imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c ? 1 1 inh 99 2 sei set interrupt mask i ? 1 1 inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m ? (a) dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin 0 inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m ? (x) dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc c b0 b7 b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 instruction set rev 2.0 12-13 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a ? (a) C (m) imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc ? (pc) + 1; push (pcl) sp ? (sp) C 1; push (pch) sp ? (sp) C 1; push (x) sp ? (sp) C 1; push (a) sp ? (sp) C 1; push (ccr) sp ? (sp) C 1; i ? 1 pch ? interrupt vector high byte pcl ? interrupt vector low byte 1 inh 83 10 tax transfer accumulator to index register x ? (a) inh 97 2 tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) C $00 dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 txa transfer index register to accumulator a ? (x) inh 9f 2 wait stop cpu clock and enable interrupts inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow flag pc program counter ccr condition code register pch program counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing rr relative program counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry flag z zero flag hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode ? logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode C( ) negation (twos complement) ix1 indexed, 8-bit offset addressing mode ? loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative flag set or cleared n any bit not affected table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
instruction set mc68hc05pl4 12-14 rev 2.0 table 12-7. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789 abcdef 0 5 brset0 3 dir 5 bset0 2 dir 3 bra 2 rel 5 neg 2 dir 3 nega 1 inh 3 negx 1 inh 6 neg 2 ix1 5 neg 1ix 9 rti 1 inh 2 sub 2 imm 3 sub 2 dir 4 sub 3 ext 5 sub 3 ix2 4 sub 2 ix1 3 sub 1ix 0 1 5 brclr0 3 dir 5 bclr0 2 dir 3 brn 2 rel 6 rts 1 inh 2 cmp 2 imm 3 cmp 2 dir 4 cmp 3 ext 5 cmp 3 ix2 4 cmp 2 ix1 3 cmp 1ix 1 2 5 brset1 3 dir 5 bset1 2 dir 3 bhi 2 rel 11 mul 1 inh 2 sbc 2 imm 3 sbc 2 dir 4 sbc 3 ext 5 sbc 3 ix2 4 sbc 2 ix1 3 sbc 1ix 2 3 5 brclr1 3 dir 5 bclr1 2 dir 3 bls 2 rel 5 com 2 dir 3 coma 1 inh 3 comx 1 inh 6 com 2 ix1 5 com 1ix 10 swi 1 inh 2 cpx 2 imm 3 cpx 2 dir 4 cpx 3 ext 5 cpx 3 ix2 4 cpx 2 ix1 3 cpx 1ix 3 4 5 brset2 3 dir 5 bset2 2 dir 3 bcc 2 rel 5 lsr 2 dir 3 lsra 1 inh 3 lsrx 1 inh 6 lsr 2 ix1 5 lsr 1ix 2 and 2 imm 3 and 2 dir 4 and 3 ext 5 and 3 ix2 4 and 2 ix1 3 and 1ix 4 5 5 brclr2 3 dir 5 bclr2 2 dir 3 bcs/blo 2 rel 2 bit 2 imm 3 bit 2 dir 4 bit 3 ext 5 bit 3 ix2 4 bit 2 ix1 3 bit 1ix 5 6 5 brset3 3 dir 5 bset3 2 dir 3 bne 2 rel 5 ror 2 dir 3 rora 1 inh 3 rorx 1 inh 6 ror 2 ix1 5 ror 1ix 2 lda 2 imm 3 lda 2 dir 4 lda 3 ext 5 lda 3 ix2 4 lda 2 ix1 3 lda 1ix 6 7 5 brclr3 3 dir 5 bclr3 2 dir 3 beq 2 rel 5 asr 2 dir 3 asra 1 inh 3 asrx 1 inh 6 asr 2 ix1 5 asr 1ix 2 tax 1 inh 4 sta 2 dir 5 sta 3 ext 6 sta 3 ix2 5 sta 2 ix1 4 sta 1ix 7 8 5 brset4 3 dir 5 bset4 2 dir 3 bhcc 2 rel 5 asl/lsl 2 dir 3 asla/lsla 1 inh 3 aslx/lslx 1 inh 6 asl/lsl 2 ix1 5 asl/lsl 1ix 2 clc 1 inh 2 eor 2 imm 3 eor 2 dir 4 eor 3 ext 5 eor 3 ix2 4 eor 2 ix1 3 eor 1ix 8 9 5 brclr4 3 dir 5 bclr4 2 dir 3 bhcs 2 rel 5 rol 2 dir 3 rola 1 inh 3 rolx 1 inh 6 rol 2 ix1 5 rol 1ix 2 sec 1 inh 2 adc 2 imm 3 adc 2 dir 4 adc 3 ext 5 adc 3 ix2 4 adc 2 ix1 3 adc 1ix 9 a 5 brset5 3 dir 5 bset5 2 dir 3 bpl 2 rel 5 dec 2 dir 3 deca 1 inh 3 decx 1 inh 6 dec 2 ix1 5 dec 1ix 2 cli 1 inh 2 ora 2 imm 3 ora 2 dir 4 ora 3 ext 5 ora 3 ix2 4 ora 2 ix1 3 ora 1ix a b 5 brclr5 3 dir 5 bclr5 2 dir 3 bmi 2 rel 2 sei 1 inh 2 add 2 imm 3 add 2 dir 4 add 3 ext 5 add 3 ix2 4 add 2 ix1 3 add 1ix b c 5 brset6 3 dir 5 bset6 2 dir 3 bmc 2 rel 5 inc 2 dir 3 inca 1 inh 3 incx 1 inh 6 inc 2 ix1 5 inc 1ix 2 rsp 1 inh 2 jmp 2 dir 3 jmp 3 ext 4 jmp 3 ix2 3 jmp 2 ix1 2 jmp 1ix c d 5 brclr6 3 dir 5 bclr6 2 dir 3 bms 2 rel 4 tst 2 dir 3 tsta 1 inh 3 tstx 1 inh 5 tst 2 ix1 4 tst 1ix 2 nop 1 inh 6 bsr 2 rel 5 jsr 2 dir 6 jsr 3 ext 7 jsr 3 ix2 6 jsr 2 ix1 5 jsr 1ix d e 5 brset7 3 dir 5 bset7 2 dir 3 bil 2 rel 2 stop 1 inh 2 ldx 2 imm 3 ldx 2 dir 4 ldx 3 ext 5 ldx 3 ix2 4 ldx 2 ix1 3 ldx 1ix e f 5 brclr7 3 dir 5 bclr7 2 dir 3 bih 2 rel 5 clr 2 dir 3 clra 1 inh 3 clrx 1 inh 6 clr 2 ix1 5 clr 1ix 2 wait 1 inh 2 txa 1 inh 4 stx 2 dir 5 stx 3 ext 6 stx 3 ix2 5 stx 2 ix1 4 stx 1ix f inh = inherent rel = relative imm = immediate ix = indexed, no offset dir = direct ix1 = indexed, 8-bit offset ext = extended ix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3 dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb m s b lsb msb f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 electrical specifications rev 2.0 13-1 section 13 electrical specifications this section contains the electrical and timing speci cations for the mc68hc05pl4. 13.1 maximum ratings maximum ratings are the extreme limits the device can be exposed to without causing permanent damage to the chip. the device is not intended to operate at these conditions. the mcu contains circuitry that protects the inputs against dam- age from high static voltages; however, do not apply voltages higher than those shown below. keep v in and v out within the range from v ss to v dd . connect unused inputs to the appropriate logical voltage level, either v ss or v dd . 13.2 operating temperature range 13.3 thermal characteristics rating symbol value unit supply voltage v dd C0.3 to +7.0 v bootloader/self-check mode (irq pin only) v in v ss C0.3 to 17 v current drain per pin excluding v dd and v ss i25ma operating junction temperature t j +150 c storage temperature range t stg C65 to +150 c characteristic symbol value unit operating temperature range mc68hc05pl4 t a t l to t h C40 to +80 c characteristic symbol value unit thermal resistance soic pdip q ja q ja 60 60 c/w c/w f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 electrical specifications mc68hc05pl4 13-2 rev 2.0 13.4 supply current characteristics notes: 1. v dd as indicated, v ss = 0 v, t l t a t h , unless otherwise noted. 2. all values shown re ect a verage measurements. 3. typical values at midpoint of voltage range, 25 c only. 4. run (operating) i dd , wait i dd : measured using external square wave clock source to osc1 pin or inter- nal oscillator, all inputs 0.2 vdc from either supply rail (v dd or v ss ); no dc loads, less than 50 pf on all outputs, c l = 20pf on osc2. 5. wait, stop i dd : all ports con gured as inputs , v il = 0.2 vdc, v ih = v dd C 0.2 vdc. 6. stop i dd measured with osc1 = v dd . 7. wait i dd is affected linearly by the osc2 capacitance. characteristic symbol min typ max unit v dd = 4.4 to 3.6 v internal rc (about 500khz) run wait stop external crystal/ceramic resonator @ 5.12mhz run wait stop i dd i dd i dd i dd i dd i dd 394 36 5 2.816 348 5 m a m a m a ma m a m a v dd = 2.5 to 2.0 v internal rc (about 500khz) run wait stop external crystal/ceramic resonator @ 2mhz run wait stop i dd i dd i dd i dd i dd i dd 128 16 3 560 66 3 m a m a m a m a m a m a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 electrical specifications rev 2.0 13-3 13.5 dc electrical characteristics (4v) notes: 1. v dd = 4.0v, v ss = 0 v, t l t a t h , unless otherwise noted. 2. all values shown re ect a verage measurements. 3. typical values at midpoint of voltage range, 25 c only. characteristic symbol min typ max unit output voltage i load = 10 m a i load = C10 m a v ol v oh v dd C0.1 0.1 v v output high voltage (i load = C0.8 ma) pa0:6, pb0:7, pc0:7, pd0:3, reset v oh v dd C0.8 v output low voltage (i load = 1.6 ma) pa0:6, pb0:7, pc0:7, pd0:3, reset (i load = 10 ma) led/irq /v pp v ol v ol 0.15 0.20 0.4 0.4 v v high sink current (v ol = 0.4) sink current per pin, pa5, pa6 sink current total for pc4:7 pins i ol i ol 9 9 10 10 ma ma input high voltage pa0:6, pb0:7, pc0:7, pd0:3, reset , led/irq /v pp v ih 0.7 x v dd v dd v input low voltage pa0:6, pb0:7, pc0:7,pd0:3, reset, led/irq /v pp v il v ss 0.3 x v dd v input current (with pulldowns disabled) pa0:6, pb0:7, pc0:7, pd0:3, reset , led/irq /v pp i in 1 m a i/o ports high-z leakage current pa0:6, pb0:7, pc0:7, pd0:3 i oz 10 m a input pulldown current (v dd = 4.0v) pb0:7 i il 3460 m a internal pull-up for pb0:7 r 110 k w f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 electrical specifications mc68hc05pl4 13-4 rev 2.0 13.6 dc electrical characteristics (2v) notes: 1. v dd = 2.0v, v ss = 0 v, t l t a t h , unless otherwise noted. 2. all values shown re ect a verage measurements. 3. typical values at midpoint of voltage range, 25 c only. characteristic symbol min typ max unit output voltage i load = 10 m a i load = C10 m a v ol v oh v dd C0.1 0.1 v v output high voltage (i load = C0.8 ma) pa0:6, pb0:7, pc0:7, pd0:3, reset v oh v dd C0.3 v output low voltage (i load = 1.6 ma) pa0:6, pb0:7, pc0:7, pd0:3, reset (i load = 10 ma) led/irq /v pp v ol v ol 0.15 0.30 v v high sink current (v ol = 0.4) sink current per pin, pa5, pa6 sink current total for pc4:7 pins i ol i ol 3 3 4 4 ma ma input high voltage pa0:6, pb0:7, pc0:7, pd0:3, reset , led/irq /v pp v ih 0.7 x v dd v dd v input low voltage pa0:6, pb0:7, pc0:7,pd0:3, reset, led/irq /v pp v il v ss 0.2 x v dd v input current (with pulldowns disabled) pa0:6, pb0:7, pc0:7, pd0:3, reset , led/irq /v pp i in 1 m a i/o ports high-z leakage current pa0:6, pb0:7, pc0:7, pd0:3 i oz 10 m a input pulldown current (v dd = 4.0v) pb0:7 i il 611 m a internal pull-up for pb0:7 r 330 k w f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 electrical specifications rev 2.0 13-5 13.7 control timing (4v) notes: 1. v dd = 4.0v, v ss = 0 v, t l t a t h , unless otherwise noted. 2. the minimum period tilil should not be less than the number of cycle times it takes to execute the interrupt service routine plus 21 t cyc . 13.8 control timing (2v) notes: 1. v dd = 2.0v, v ss = 0 v, t l t a t h , unless otherwise noted. 2. the minimum period tilil should not be less than the number of cycle times it takes to execute the interrupt service routine plus 21 t cyc . characteristic symbol min max unit frequency of oscillation (osc) rc oscillator option crystal oscillator option external clock source f osc f osc f osc 200 0.1 dc 500 5.12 5.12 khz mhz mhz internal operating frequency, crystal or external clock (f osc /2) rc oscillator option crystal oscillator option external clock source f op f op f op 100 0.05 dc 250 2.56 2.56 khz mhz mhz cycle time rc oscillator option external oscillator or clock source t cyc t cyc 4 0.39 m s m s osc1 pulse width (external clock input) t oh ,t ol 195 ns timer resolution input capture (tcap) pulse width t resl t th , t tl 4 284 t cyc ns interrupt pulse width low (edge-triggered) t ilih 284 ns interrupt pulse period t ilil see note 2 t cyc characteristic symbol min max unit frequency of oscillation (osc) rc oscillator option crystal oscillator option external clock source f osc f osc f osc 200 0.1 dc 500 2 2 khz mhz mhz internal operating frequency, crystal or external clock (f osc /2) rc oscillator option crystal oscillator option external clock source f op f op f op 100 0.05 dc 250 1 1 khz mhz mhz cycle time rc oscillator option external oscillator or clock source t cyc t cyc 4 1 m s m s osc1 pulse width (external clock input) t oh ,t ol 5ns timer resolution input capture (tcap) pulse width t resl t th , t tl 4 284 t cyc ns interrupt pulse width low (edge-triggered) t ilih 284 ns interrupt pulse period t ilil see note 2 t cyc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 electrical specifications mc68hc05pl4 13-6 rev 2.0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 mechanical specifications rev 2.0 14-1 section 14 mechanical specifications this section provides the mechanical dimensions for the 28-pin pdip, 28-pin soic, and 28-pin ssop packages. 14.1 28-pin pdip (case 710) 14.2 28-pin soic (case 751f)        
   
         
   
         
        
  

  

      
          
       
 !    ! !      #!  %%  ! $" ! !  ! ! !    !     ! !   #        ! "    114 15 28 b a c n k m j d     f hg l             
    
   
          
            
          
     
         !      !    %
    !   !        ! "  !" 
 $"  !"            ! "  !"  #  !"       !!  $     ! $" ! ! -a- -b- 114 15 28 -t- c           m j -t- k 26x g 28x d 14x p r x 45 f    !    f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 mechanical specifications mc68hc05pl4 14-2 rev 2.0 14.3 28-pin ssop -d- a - t - e b a 1 n 1.00 dia. h 3 4 4 a 2 6 side view end view top view seating plane -e- 1 2 3 see detail "a" - c - 2.36 bottom view e/2 d/2 1.00 1.00 dia. pin 7 8 p i n e s - p h i l i p c 0.076 m +e m 0.20 s d 0.12 m t e + b1 c b c1 base metal 8 10 section g-g with lead finish 12-16 parting line detail 'a' 5 l1 g g 0.25 bsc gauge plane seating plane l 0 min. 0.235 min r 7. 6. controlling dimension: millimeters. 9. 1. maximum die thickness allowable is 0.43mm (.017 inches). allowable dambar protrusion shall be 0.13mm total in dimension b does not include dambar protrusion/intrusion. 8. one another within 0.08mm at seating plane. 5. 4. 3. 2. formed leads shall be planar with respect to terminal positions are shown for reference only. for soldering to a substrate. dimension is the length of terminal protrusions shall not exceed 0.15mm per side. at the parting line, mold flash or do include mold mismatch and are measured include mold flash or protrusions, but "d" & "e" are reference datums and do not "t" is a reference datum. notes: dimensioning & tolerances per ansi.y14.5m-1982. excess of b dimension at maximum material condition. dambar intrusion shall not reduce dimension b by more than 0.07mm at least material condition. 10. these dimensions apply to the flat section of the lead between 0.10 and 0.25mm from lead tips. this package outline drawing complies with jedec specification no. mo-150 for the lead counts shown 11. 8 0 dimensions in mm min. max. l 1 n h e e d a a o l y m b s nom. 4 a 2 0.65 bsc 1.86 0.13 1.73 1.78 0.21 1.99 1.73 0.05 1.68 5.20 5.30 5.38 7.65 0.63 0.75 7.80 7.90 0.95 28 10.07 10.20 10.33 b 0.25 0.38 b1 0.25 0.30 0.33 c1 0.09 0.15 0.16 c 0.09 0.20 1.25 ref. l1 o n e t 6 4 4 5 10 8,10 10 10 r 0.09 0.15 .407 .402 .397 28 .037 .311 .307 .030 .025 .301 .212 .209 .205 .066 .002 .068 .078 .008 .070 .068 .005 .073 .0256 bsc 4 nom. max. min. dimensions in inch 08 .010 .015 .010 .012 .013 .004 .008 .004 .006 .006 .049 ref. .004 .006 m m f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 rev 2.0 a-1 appendix a mc68hc705pl4 this appendix describes the mc68hc705pl4 and mc68hc705pl4b, the emula- tion parts for mc68hc05pl4 and mc68HC05PL4B respectively. the entire mc68hc05pl4 data sheet applies to the mc68hc705pl4 and mc68hc705pl4b, with exceptions outlined in this appendix. references to mc68hc705pl4 in this appendix refers to both the mc68hc705pl4 and mc68hc705pl4b devices, unless otherwise stated. a.1 introduction the mc68hc705pl4 is an eprom version of the mc68hc705pl4, and the mc68hc705pl4b is an eprom version of the mc68hc705pl4b. both hc705 parts are used as the emulation part for their mc68hc05 counterparts. both mc68hc705 parts are functionally identical to their mc68hc05 counterparts, with the exception of the 4k-bytes user rom is replaced by 4k-bytes user eprom. a.2 memory the mc68hc705pl4 memory map is shown on figure a-1 . a.3 bootloader mode bootloader mode is entered upon the rising edge of reset if led/irq /v pp pin is at v tst and pb0/kbi0 at v dd . the bootloader program is masked in the rom area from $1e00 to $1fef. this program handles copying of user code from an external eprom into the on-chip eprom. the bootload function has to be done from an external eprom. the bootloader performs one programming pass at 1ms per byte then does a verify pass. a.4 eprom programming programming the on-chip eprom is achieved by using the program control reg- ister located at address $001e. please contact freescale for programming board availability. table a-1. mc68hc705pl4 and mc68hc705pl4b differences device pin27 mc68hc705pl4 pa0 mc68hc705pl4b osc2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 mc68hc05pl4 a-2 rev 2.0 figure a-1. mc68hc705pl4b memory map a.4.1 eprom program control register (pcn) this register is provided for programming the on-chip eprom in the mc68hc705pl4. elat ?eprom latch control 0 = eprom address and data bus con gured f or normal reads 1 = eprom address and data bus con gured for programming (writes to eprom cause address and data to be latched). eprom is in programming mode and cannot be read if elat is 1. this bit should not be set when no programming voltage is applied to the v pp pin. pcr $001e bit-7 bit-6 bit-5 bit4 bit-3 bit-2 bit1 bit-0 read reserved elat pgm write reset 0000 0 000 i/o registers 32 bytes user ram 256 bytes unused user eprom 4096 bytes bootstrap rom 496 bytes $0000 $001f $0020 $011f $0120 $0dff $0e00 $1dff $1e00 $1fef $1fff $1ff0 $00c0 $00ff stack 64 bytes user vectors 16 bytes reserved reserved keyboard 8-bit timer 16-bit timer irq swi reset $1ff0-$1ff1 $1ff2-$1ff3 $1ff4-$1ff5 $1ff6-$1ff7 $1ff8-$1ff9 $1ffa-$1ffb $1ffc-$1ffd $1ffe-$1fff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 rev 2.0 a-3 pgm ?eprom program command 0 = programming power is switched off from eprom array. 1 = programming power is switched on to eprom array. if elat 1 1, then pgm = 0. a.4.2 programming sequence the eprom programming sequence is: 1. set the elat bit 2. write the data to the address to be programmed 3. set the pgm bit 4. delay for a time t pgmr 5. clear the pgm bit 6. clear the elat bit the last two steps must be performed with separate cpu writes. caution it is important to remember that an external programming voltage must be applied to the v pp pin while programming, but it should be equal to v dd during normal operations. figure a-2 shows the o w required to successfully program the eprom. a.5 eprom programming specifications table a-2. eprom programming electrical characteristics (v dd = 4v 10%, v ss = 0 vdc, t a = 0 c to +70 c, unless otherwise noted) characteristic symbol min typ max unit programming voltage v pp 12.5 v programming current i pp 5 10 ma programming time per byte t epgm 1ms f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 mc68hc05pl4 a-4 rev 2.0 figure a-2. eprom programming sequence start elat=1 write eprom byte epgm=1 wait 1ms epgm=0 elat=0 write additional byte? n y end f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
april 30, 1998 general release specification mc68hc05pl4 rev 2.0 a-5 figure a-3. mc68hc705pl4 pin assignment figure a-4. mc68hc705pl4b pin assignment 1 2 3 4 5 6 7 8 9 10 28 27 26 25 24 23 22 21 20 19 vss vdd pc7 pc6 reset pb7 pb6 pb5 pb4 pb3/kbi3 pc5 pc4 pb2/kbi2 pb1/kbi1 osc1 pa0 pc0 pc1 pa1/dtmf pa2/tcap pa3/tcmp pa4 pa5 pa6 pc2 pc3 led/irq /vpp pb0/kbi0 11 12 13 14 18 17 16 15 1 2 3 4 5 6 7 8 9 10 28 27 26 25 24 23 22 21 20 19 vss vdd pc7 pc6 reset pb7 pb6 pb5 pb4 pb3/kbi3 pc5 pc4 pb2/kbi2 pb1/kbi1 osc1 osc2 pc0 pc1 pa1/dtmf pa2/tcap pa3/tcmp pa4 pa5 pa6 pc2 pc3 led/irq /vpp pb0/kbi0 11 12 13 14 18 17 16 15 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification april 30, 1998 mc68hc05pl4 a-6 rev 2.0 a.6 supply current characteristics notes: 1. v dd as indicated, v ss = 0 v, t l t a t h , unless otherwise noted. 2. all values shown re ect a verage measurements. 3. typical values at midpoint of voltage range, 25 c only. 4. run (operating) i dd , wait i dd : measured using external square wave clock source to osc1 pin or inter- nal oscillator, all inputs 0.2 vdc from either supply rail (v dd or v ss ); no dc loads, less than 50 pf on all outputs, c l = 20pf on osc2. 5. wait, stop i dd : all ports con gured as inputs , v il = 0.2 vdc, v ih = v dd C 0.2 vdc. 6. stop i dd measured with osc1 = v dd . 7. wait i dd is affected linearly by the osc2 capacitance. characteristic symbol min typ max unit v dd = 4.4 v to 3.6v internal rc (about 500khz) run wait stop external crystal/ceramic resonator @ 5.12mhz run wait stop i dd i dd i dd i dd i dd i dd 966 486 4 4.398 922 5 m a m a m a ma m a m a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
hc05pl4grs/h f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .


▲Up To Search▲   

 
Price & Availability of 68HC05PL4B

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X